diff options
Diffstat (limited to 'src/wins.c')
-rwxr-xr-x | src/wins.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $calcurse: wins.c,v 1.14 2008/04/18 17:53:31 culot Exp $ */ +/* $calcurse: wins.c,v 1.15 2008/04/19 09:22:14 culot Exp $ */ /* * Calcurse - text-based organizer @@ -145,7 +145,7 @@ wins_scrollwin_delete (scrollwin_t *sw) void wins_scrollwin_display (scrollwin_t *sw) { - const int visible_lines = sw->win.h - sw->pad.x; + const int visible_lines = sw->win.h - sw->pad.y - 1; if (sw->total_lines > visible_lines) { @@ -166,6 +166,21 @@ wins_scrollwin_display (scrollwin_t *sw) doupdate (); } +void +wins_scrollwin_up (scrollwin_t *sw) +{ + if (sw->first_visible_line > 0) + sw->first_visible_line--; +} + +void +wins_scrollwin_down (scrollwin_t *sw) +{ + if (sw->total_lines + > (sw->first_visible_line + sw->win.h - sw->pad.y - 1)) + sw->first_visible_line++; +} + /* * Delete the existing windows and recreate them with their new * size and placement. |