summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-11-05 19:23:34 +0000
committerThomas Martitz <kugel@rockbox.org>2010-11-05 19:23:34 +0000
commit12f5a1e60e0806527f49366effeed19bf67d8a1b (patch)
tree4efc16de3fc6c14b054e2001caea6f74ef602f4b /apps
parent5411e14c57185b2b33fbfbb7ff7fec8ca2700551 (diff)
downloadrockbox-12f5a1e60e0806527f49366effeed19bf67d8a1b.tar.gz
rockbox-12f5a1e60e0806527f49366effeed19bf67d8a1b.tar.bz2
rockbox-12f5a1e60e0806527f49366effeed19bf67d8a1b.zip
Make the context menu pop up instantly after the long press timeout when holding a list item instead of just after the thumb/styles left the screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28499 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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)
&& !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 = false;
if (button == ACTION_NONE || button == ACTION_UNKNOWN)
{
@@ -738,21 +741,23 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
return ACTION_NONE;
}
+ if (button & BUTTON_REPEAT && scroll_mode == SCROLL_NONE
+ && !wait_for_release)
+ {
+ /* 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;
+ return ACTION_STD_CONTEXT;
+ }
if (released && !cancelled_kinetic)
{
/* Pen was released anywhere on the screen */
last_position = 0;
if (scroll_mode == SCROLL_NONE)
{
+ /* select current line */
gui_synclist_select_item(gui_list, list_start_item + line);
- /* If BUTTON_REPEAT is set, then the pen was hold on
- * the same line for some time
- * -> context menu
- * otherwise,
- * -> select
- **/
- if (button & BUTTON_REPEAT)
- return ACTION_STD_CONTEXT;
return ACTION_STD_OK;
}
else