From: Christian Heller Date: Thu, 6 Jun 2013 10:31:18 +0000 (+0200) Subject: Added pad scrolling hints. X-Git-Tag: tce~1246 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/condition?a=commitdiff_plain;h=72271854245c3704905888fc21f1c55760a3892c;p=plomrogue Added pad scrolling hints. --- 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) {