1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Martitz 2010-11-05 19:23:34 +00:00
parent 5411e14c57
commit 12f5a1e60e

View file

@ -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