summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/bitmap/list.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 26e15e7978..268209e1c1 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -486,16 +486,26 @@ void _gui_synclist_stop_kinetic_scrolling(void)
486 * otherwise it returns true even if it didn't actually scroll, 486 * otherwise it returns true even if it didn't actually scroll,
487 * but scrolling mode shouldn't be changed 487 * but scrolling mode shouldn't be changed
488 **/ 488 **/
489
490
491static int scroll_begin_threshold;
492static int threshold_accumulation;
489static bool swipe_scroll(struct gui_synclist * gui_list, int line_height, int difference) 493static bool swipe_scroll(struct gui_synclist * gui_list, int line_height, int difference)
490{ 494{
491 /* fixme */ 495 /* fixme */
492 const enum screen_type screen = screens[SCREEN_MAIN].screen_type; 496 const enum screen_type screen = screens[SCREEN_MAIN].screen_type;
493 const int nb_lines = viewport_get_nb_lines(&list_text[screen]); 497 const int nb_lines = viewport_get_nb_lines(&list_text[screen]);
494 498
499 if (UNLIKELY(scroll_begin_threshold == 0))
500 scroll_begin_threshold = touchscreen_get_scroll_threshold();
501
495 /* make selecting items easier */ 502 /* make selecting items easier */
496 if (abs(difference) < SCROLL_BEGIN_THRESHOLD && scroll_mode == SCROLL_NONE) 503 threshold_accumulation += abs(difference);
504 if (threshold_accumulation < scroll_begin_threshold && scroll_mode == SCROLL_NONE)
497 return false; 505 return false;
498 506
507 threshold_accumulation = 0;
508
499 /* does the list even scroll? if no, return but still show 509 /* does the list even scroll? if no, return but still show
500 * the caller that we would scroll */ 510 * the caller that we would scroll */
501 if (nb_lines >= gui_list->nb_items) 511 if (nb_lines >= gui_list->nb_items)