summaryrefslogtreecommitdiffstats
path: root/src/wins.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wins.c')
-rwxr-xr-xsrc/wins.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/wins.c b/src/wins.c
index 189e149..2d846fb 100755
--- a/src/wins.c
+++ b/src/wins.c
@@ -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.