From d48f1a0a4545316e024f7ccfd78112f6d1a466f5 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Fri, 15 May 2009 05:08:28 +0000 Subject: get the quickscreen working on the mr500. hold "mode" on the remote to get to it, then you can use the 4 directions on the remote, or the touchscreen to change the values. "mode" will exit, as will pressing in the top or middle of the main screen git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20935 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/quickscreen.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'apps/gui/quickscreen.c') diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index 4eaffa0f46..7100eb7489 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c @@ -275,7 +275,28 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) talk_qs_option((struct settings_list *)qs->items[item], false); return true; } - +#ifdef HAVE_TOUCHSCREEN +/* figure out which button was pressed... + * top is exit, left/right/botton are the respective actions + */ +static int quickscreen_touchscreen_button(void) +{ + short x,y; + if (action_get_touchscreen_press(&x, &y) != BUTTON_REL) + return ACTION_NONE; + if (y < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y) + return ACTION_STD_CANCEL; + else if (y > vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y + + vps[SCREEN_MAIN][QUICKSCREEN_LEFT].height) + return ACTION_QS_DOWN; + else if (x < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].x + + vps[SCREEN_MAIN][QUICKSCREEN_LEFT].width) + return ACTION_QS_LEFT; + else if (x >= vps[SCREEN_MAIN][QUICKSCREEN_RIGHT].x) + return ACTION_QS_RIGHT; + return ACTION_STD_CANCEL; +} +#endif bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) { int button, i; @@ -303,6 +324,10 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) talk_qs_option((struct settings_list *)qs->items[QUICKSCREEN_RIGHT], true); while (true) { button = get_action(CONTEXT_QUICKSCREEN,HZ/5); +#ifdef HAVE_TOUCHSCREEN + if (button == ACTION_TOUCHSCREEN) + button = quickscreen_touchscreen_button(); +#endif if(default_event_handler(button) == SYS_USB_CONNECTED) return(true); if(gui_quickscreen_do_button(qs, button)) -- cgit v1.2.3