forked from len0rd/rockbox
Don't forget the touchscreen targets!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22636 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
533c29b2f2
commit
9c938a23b9
1 changed files with 9 additions and 8 deletions
|
|
@ -289,20 +289,21 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
|
||||||
/* figure out which button was pressed...
|
/* figure out which button was pressed...
|
||||||
* top is exit, left/right/botton are the respective actions
|
* top is exit, left/right/botton are the respective actions
|
||||||
*/
|
*/
|
||||||
static int quickscreen_touchscreen_button(void)
|
static int quickscreen_touchscreen_button(const struct viewport
|
||||||
|
vps[QUICKSCREEN_ITEM_COUNT])
|
||||||
{
|
{
|
||||||
short x,y;
|
short x,y;
|
||||||
if (action_get_touchscreen_press(&x, &y) != BUTTON_REL)
|
if (action_get_touchscreen_press(&x, &y) != BUTTON_REL)
|
||||||
return ACTION_NONE;
|
return ACTION_NONE;
|
||||||
if (y < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y)
|
if (y < vps[QUICKSCREEN_LEFT].y)
|
||||||
return ACTION_STD_CANCEL;
|
return ACTION_STD_CANCEL;
|
||||||
else if (y > vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y +
|
else if (y > vps[QUICKSCREEN_LEFT].y +
|
||||||
vps[SCREEN_MAIN][QUICKSCREEN_LEFT].height)
|
vps[QUICKSCREEN_LEFT].height)
|
||||||
return ACTION_QS_DOWN;
|
return ACTION_QS_DOWN;
|
||||||
else if (x < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].x +
|
else if (x < vps[QUICKSCREEN_LEFT].x +
|
||||||
vps[SCREEN_MAIN][QUICKSCREEN_LEFT].width)
|
vps[QUICKSCREEN_LEFT].width)
|
||||||
return ACTION_QS_LEFT;
|
return ACTION_QS_LEFT;
|
||||||
else if (x >= vps[SCREEN_MAIN][QUICKSCREEN_RIGHT].x)
|
else if (x >= vps[QUICKSCREEN_RIGHT].x)
|
||||||
return ACTION_QS_RIGHT;
|
return ACTION_QS_RIGHT;
|
||||||
return ACTION_STD_CANCEL;
|
return ACTION_STD_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
@ -339,7 +340,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
|
||||||
button = get_action(CONTEXT_QUICKSCREEN,HZ/5);
|
button = get_action(CONTEXT_QUICKSCREEN,HZ/5);
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
if (button == ACTION_TOUCHSCREEN)
|
if (button == ACTION_TOUCHSCREEN)
|
||||||
button = quickscreen_touchscreen_button();
|
button = quickscreen_touchscreen_button(vps[SCREEN_MAIN]);
|
||||||
#endif
|
#endif
|
||||||
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
||||||
return(true);
|
return(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue