summaryrefslogtreecommitdiff
path: root/src/wins.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2008-04-19 09:22:14 +0000
committerFrederic Culot <calcurse@culot.org>2008-04-19 09:22:14 +0000
commit2e798df3cb498b0e2150a5c2ace47eb80281237e (patch)
treeb4a6216f1f42808f131cab1a13e485fcd8224bf0 /src/wins.c
parentf0d44091519e26b160ce12bc7366d02f196ac852 (diff)
downloadcalcurse-2e798df3cb498b0e2150a5c2ace47eb80281237e.zip
Scrollbar added in general configuration menu
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.