summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/bitmap/list.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index d78f005e6a..26e15e7978 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -630,8 +630,11 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
630 && !is_kinetic_over()); 630 && !is_kinetic_over());
631 int icon_width = 0; 631 int icon_width = 0;
632 int line, list_width = list_text_vp->width; 632 int line, list_width = list_text_vp->width;
633 static bool wait_for_release = false;
633 634
634 released = (button&BUTTON_REL) != 0; 635 released = (button&BUTTON_REL) != 0;
636 if (released)
637 wait_for_release = false;
635 638
636 if (button == ACTION_NONE || button == ACTION_UNKNOWN) 639 if (button == ACTION_NONE || button == ACTION_UNKNOWN)
637 { 640 {
@@ -738,21 +741,23 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
738 return ACTION_NONE; 741 return ACTION_NONE;
739 } 742 }
740 743
744 if (button & BUTTON_REPEAT && scroll_mode == SCROLL_NONE
745 && !wait_for_release)
746 {
747 /* held a single line for a while, bring up the context menu */
748 gui_synclist_select_item(gui_list, list_start_item + line);
749 /* don't sent context repeatedly */
750 wait_for_release = true;
751 return ACTION_STD_CONTEXT;
752 }
741 if (released && !cancelled_kinetic) 753 if (released && !cancelled_kinetic)
742 { 754 {
743 /* Pen was released anywhere on the screen */ 755 /* Pen was released anywhere on the screen */
744 last_position = 0; 756 last_position = 0;
745 if (scroll_mode == SCROLL_NONE) 757 if (scroll_mode == SCROLL_NONE)
746 { 758 {
759 /* select current line */
747 gui_synclist_select_item(gui_list, list_start_item + line); 760 gui_synclist_select_item(gui_list, list_start_item + line);
748 /* If BUTTON_REPEAT is set, then the pen was hold on
749 * the same line for some time
750 * -> context menu
751 * otherwise,
752 * -> select
753 **/
754 if (button & BUTTON_REPEAT)
755 return ACTION_STD_CONTEXT;
756 return ACTION_STD_OK; 761 return ACTION_STD_OK;
757 } 762 }
758 else 763 else