diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/bitmap/list.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index 2b5a99fb9f..db8e0504d7 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c | |||
@@ -359,8 +359,7 @@ static enum { | |||
359 | SCROLL_KINETIC, /* state after releasing swipe */ | 359 | SCROLL_KINETIC, /* state after releasing swipe */ |
360 | } scroll_mode; | 360 | } scroll_mode; |
361 | 361 | ||
362 | static int scrollbar_scroll(struct gui_synclist * gui_list, | 362 | static int scrollbar_scroll(struct gui_synclist * gui_list, int y) |
363 | int y) | ||
364 | { | 363 | { |
365 | const int screen = screens[SCREEN_MAIN].screen_type; | 364 | const int screen = screens[SCREEN_MAIN].screen_type; |
366 | const int nb_lines = list_get_nb_lines(gui_list, screen); | 365 | const int nb_lines = list_get_nb_lines(gui_list, screen); |
@@ -369,11 +368,9 @@ static int scrollbar_scroll(struct gui_synclist * gui_list, | |||
369 | { | 368 | { |
370 | /* scrollbar scrolling is still line based */ | 369 | /* scrollbar scrolling is still line based */ |
371 | y_offset = 0; | 370 | y_offset = 0; |
372 | int scrollbar_size = nb_lines*gui_list->line_height[screen]; | 371 | int scrollbar_size = nb_lines * gui_list->line_height[screen]; |
373 | int actual_y = y - list_text[screen].y; | 372 | int actual_y = y - list_text[screen].y; |
374 | 373 | int new_selection = (actual_y * gui_list->nb_items) / scrollbar_size; | |
375 | int new_selection = (actual_y * gui_list->nb_items) | ||
376 | / scrollbar_size; | ||
377 | 374 | ||
378 | int start_item = new_selection - nb_lines/2; | 375 | int start_item = new_selection - nb_lines/2; |
379 | if(start_item < 0) | 376 | if(start_item < 0) |
@@ -839,7 +836,7 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * list) | |||
839 | hide_selection = true; | 836 | hide_selection = true; |
840 | /* similarly to swipe scroll, using the scrollbar grabs | 837 | /* similarly to swipe scroll, using the scrollbar grabs |
841 | * focus so the click location is irrelevant */ | 838 | * focus so the click location is irrelevant */ |
842 | scrollbar_scroll(list, adj_y); | 839 | scrollbar_scroll(list, y); |
843 | if (action & BUTTON_REL) | 840 | if (action & BUTTON_REL) |
844 | scroll_mode = SCROLL_NONE; | 841 | scroll_mode = SCROLL_NONE; |
845 | break; | 842 | break; |