Added horizontal scroll for resized windows

Signed-off-by: James Booth <boothj5@gmail.com>
This commit is contained in:
Immae
2014-06-19 15:48:02 +02:00
committed by James Booth
parent d668d15081
commit 5e841febd0
3 changed files with 36 additions and 3 deletions

View File

@@ -48,6 +48,7 @@ win_create(const char * const title, int cols, win_type_t type)
new_win->win = newpad(PAD_SIZE, cols);
wbkgd(new_win->win, COLOUR_TEXT);
new_win->y_pos = 0;
new_win->x_pos = 0;
new_win->paged = 0;
new_win->unread = 0;
new_win->history_shown = 0;
@@ -118,7 +119,7 @@ win_update_virtual(ProfWin *window)
{
int rows, cols;
getmaxyx(stdscr, rows, cols);
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, cols-1);
pnoutrefresh(window->win, window->y_pos, window->x_pos, 1, 0, rows-3, cols-1);
}
void
@@ -131,6 +132,7 @@ win_move_to_end(ProfWin *window)
int size = rows - 3;
window->y_pos = y - (size - 1);
window->x_pos = 0;
if (window->y_pos < 0) {
window->y_pos = 0;
}