From 430ada08644336c3811c6188f1a1d91b1614efc2 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 2 Feb 2011 18:30:10 +0000 Subject: Redo r29168. Use similar but existing mechanism in the action system which seems to work better. Don't eat buttons on context change if it was waiting for button release (you did need another release). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29192 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/bitmap/list.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'apps/gui/bitmap') diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index 3da0d0bb7f..2050043787 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -640,21 +640,9 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) && !is_kinetic_over()); int icon_width = 0; int line, list_width = list_text_vp->width; - static bool wait_for_release = false; released = (button&BUTTON_REL) != 0; - if (released && wait_for_release) - { /* was waiting on a release, reset everything so the next call - * can start from new */ - wait_for_release = false; - last_position = 0; - if (scroll_mode == SCROLL_KINETIC) - kinetic_force_stop(); - scroll_mode = SCROLL_NONE; - return ACTION_NONE; - } - if (button == ACTION_NONE || button == ACTION_UNKNOWN) { /* this happens when we hit edges of the list while kinetic scrolling, @@ -760,13 +748,13 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) return ACTION_NONE; } - if (button & BUTTON_REPEAT && scroll_mode == SCROLL_NONE - && !wait_for_release) + if (button & BUTTON_REPEAT && scroll_mode == SCROLL_NONE) { /* held a single line for a while, bring up the context menu */ gui_synclist_select_item(gui_list, list_start_item + line); /* don't sent context repeatedly */ - wait_for_release = true; + action_wait_for_release(); + last_position = 0; return ACTION_STD_CONTEXT; } if (released && !cancelled_kinetic) -- cgit v1.2.3