From 72271854245c3704905888fc21f1c55760a3892c Mon Sep 17 00:00:00 2001 From: Christian Heller <c.heller@plomlompom.de> Date: Thu, 6 Jun 2013 12:31:18 +0200 Subject: [PATCH] Added pad scrolling hints. --- windows.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/windows.c b/windows.c index 775f324..37f8756 100644 --- a/windows.c +++ b/windows.c @@ -172,7 +172,7 @@ void draw_windows (struct Win * win) { draw_windows (win->next); } } void draw_all_windows (struct WinMeta * win_meta) { -// Draw all windows and their borders. +// Draw pad with all windows and their borders, plus scrolling hints. erase(); wnoutrefresh(win_meta->screen); werase(win_meta->pad); @@ -191,8 +191,16 @@ void draw_all_windows (struct WinMeta * win_meta) { mvwaddch(win_meta->pad, all_corners[i].tr.y, all_corners[i].tr.x, '+'); mvwaddch(win_meta->pad, all_corners[i].bl.y, all_corners[i].bl.x, '+'); mvwaddch(win_meta->pad, all_corners[i].br.y, all_corners[i].br.x, '+'); } - pnoutrefresh(win_meta->pad, 0, win_meta->pad_offset, 0, 0, win_meta->height, win_meta->width - 1); - free(all_corners); } + // pnoutrefresh(win_meta->pad, 0, win_meta->pad_offset, 0, 0, win_meta->height, win_meta->width - 1); + free(all_corners); + uint16_t y; + if (win_meta->pad_offset > 0) + for (y = 0; y < win_meta->height; y++) + mvwaddch(win_meta->pad, y, win_meta->pad_offset, '<' | A_REVERSE); + if (win_meta->pad_offset + win_meta->width < getmaxx(win_meta->pad)) + for (y = 0; y < win_meta->height; y++) + mvwaddch(win_meta->pad, y, win_meta->pad_offset + win_meta->width - 1, '>' | A_REVERSE); + pnoutrefresh(win_meta->pad, 0, win_meta->pad_offset, 0, 0, win_meta->height, win_meta->width - 1); } doupdate(); } void resize_active_window (struct WinMeta * win_meta, uint16_t height, uint16_t width) { -- 2.30.2