scroll by one line in textlist

to scroll by only one line, hold CONTROL key and scroll with
mouse wheel
This commit is contained in:
Cedric Roux
2016-07-27 13:05:46 +02:00
parent b07efe7a01
commit d62de525eb
4 changed files with 10 additions and 4 deletions
+3
View File
@@ -89,6 +89,8 @@ static void scroll(void *private, gui *g,
int number_of_lines;
int new_line;
int inc;
int *d = notification_data;
int key_modifiers = *d;
if (pthread_mutex_lock(&this->lock)) abort();
@@ -96,6 +98,7 @@ static void scroll(void *private, gui *g,
inc = 10;
if (inc > visible_lines - 2) inc = visible_lines - 2;
if (inc < 1) inc = 1;
if (key_modifiers & KEY_CONTROL) inc = 1;
if (!strcmp(notification, "scrollup")) inc = -inc;
new_line = start_line + inc;