aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-05-04 18:46:28 -0400
committerJesse Luehrs <doy@tozt.net>2014-05-04 18:46:28 -0400
commitc48544e613903c617c1318b1f1cc4d7eae9daa47 (patch)
treed8051bbe946d7f611b43e9c8866b22ab1b225d50 /src/window-xlib.c
parent3c4d1c9d43c80abf5a938d1f5416e7a9d4f339dd (diff)
downloadrunes-c48544e613903c617c1318b1f1cc4d7eae9daa47.tar.gz
runes-c48544e613903c617c1318b1f1cc4d7eae9daa47.zip
allow the number of lines to scroll at a time to be configurable
Diffstat (limited to 'src/window-xlib.c')
-rw-r--r--src/window-xlib.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c
index d792cfc..96d2558 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -759,18 +759,20 @@ static int runes_window_backend_handle_builtin_button_press(
return 1;
break;
case Button4:
- if (t->scr.row_visible_offset < t->scr.row_count - t->scr.max.row) {
- t->scr.row_visible_offset++;
- t->scr.dirty = 1;
- runes_window_backend_flush(t);
+ t->scr.row_visible_offset += t->config.scroll_lines;
+ if (t->scr.row_visible_offset > t->scr.row_count - t->scr.max.row) {
+ t->scr.row_visible_offset = t->scr.row_count - t->scr.max.row;
}
+ t->scr.dirty = 1;
+ runes_window_backend_flush(t);
break;
case Button5:
- if (t->scr.row_visible_offset > 0) {
- t->scr.row_visible_offset--;
- t->scr.dirty = 1;
- runes_window_backend_flush(t);
+ t->scr.row_visible_offset -= t->config.scroll_lines;
+ if (t->scr.row_visible_offset < 0) {
+ t->scr.row_visible_offset = 0;
}
+ t->scr.dirty = 1;
+ runes_window_backend_flush(t);
break;
default:
break;