diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2012-07-06 14:28:34 +1000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2012-07-06 14:28:34 +1000 |
commit | 68ee7aac6e7a16804ac6880cc076c43502989c92 (patch) | |
tree | c352d6ee4e7517d2469c0677123a975f0f66646e /apps/gui/skin_engine | |
parent | 65f9df3083623484efccf502c33ecc959555d247 (diff) |
skin_engine: Make pressing the setting bar touch region work
might need some tweaking, but works.
Change-Id: I0784cd4fe9996531da6cc275491ff3b4e83cdbcf
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 6 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 14 |
2 files changed, 19 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index cbc2ebed4e..237e4033e2 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -1091,7 +1091,9 @@ static int parse_progressbar_tag(struct skin_element* element, #ifdef HAVE_TOUCHSCREEN if (!suppress_touchregion && - (token->type == SKIN_TOKEN_VOLUMEBAR || token->type == SKIN_TOKEN_PROGRESSBAR)) + (token->type == SKIN_TOKEN_VOLUMEBAR || + token->type == SKIN_TOKEN_PROGRESSBAR || + token->type == SKIN_TOKEN_SETTINGBAR)) { struct touchregion *region = skin_buffer_alloc(sizeof(*region)); struct skin_token_list *item; @@ -1102,6 +1104,8 @@ static int parse_progressbar_tag(struct skin_element* element, if (token->type == SKIN_TOKEN_VOLUMEBAR) region->action = ACTION_TOUCH_VOLUME; + else if (token->type == SKIN_TOKEN_SETTINGBAR) + region->action = ACTION_TOUCH_SETTING; else region->action = ACTION_TOUCH_SCROLLBAR; diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index f685cd0b70..337d3ef5f7 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c @@ -104,6 +104,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, { case ACTION_TOUCH_SCROLLBAR: case ACTION_TOUCH_VOLUME: + case ACTION_TOUCH_SETTING: if (edge_offset) { struct progressbar *bar = @@ -284,6 +285,19 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, returncode = ACTION_REDRAW; } break; + case ACTION_TOUCH_SETTING: + { + struct progressbar *bar = + SKINOFFSETTOPTR(skin_buffer, temp->bar); + if (bar && edge_offset) + { + int val, count; + get_setting_info_for_bar(bar->setting_id, &count, &val); + val = *edge_offset * count / 100; + update_setting_value_from_touch(bar->setting_id, val); + } + } + break; } return returncode; } |