diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-21 12:43:08 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-21 12:43:08 +0000 |
commit | adc9cb1adc667997808b0abdbf8749fcbdbbf461 (patch) | |
tree | 7ef600a4946b6e67aa6bc9db29acebd9658341bd /apps/gui | |
parent | e481e887db23d634c8c2dfcec1594eec0646a63d (diff) | |
download | rockbox-adc9cb1adc667997808b0abdbf8749fcbdbbf461.tar.gz rockbox-adc9cb1adc667997808b0abdbf8749fcbdbbf461.zip |
Allow the progressbar and volume touch regions to be reverse by prepending them with ! (so full is the left/top instead of right/bottom)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27013 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 7 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 2 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index bbcb3fe8f7..b9254d9dbd 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -1578,12 +1578,19 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1578 | region->height = h; | 1578 | region->height = h; |
1579 | region->wvp = curr_vp; | 1579 | region->wvp = curr_vp; |
1580 | region->armed = false; | 1580 | region->armed = false; |
1581 | region->reverse_bar = false; | ||
1581 | 1582 | ||
1582 | end = strchr(action, ')'); | 1583 | end = strchr(action, ')'); |
1583 | if (!end || (size_t)(end-action+1) > sizeof temp) | 1584 | if (!end || (size_t)(end-action+1) > sizeof temp) |
1584 | return WPS_ERROR_INVALID_PARAM; | 1585 | return WPS_ERROR_INVALID_PARAM; |
1585 | strlcpy(temp, action, end-action+1); | 1586 | strlcpy(temp, action, end-action+1); |
1586 | action = temp; | 1587 | action = temp; |
1588 | |||
1589 | if (*action == '!') | ||
1590 | { | ||
1591 | region->reverse_bar = true; | ||
1592 | action++; | ||
1593 | } | ||
1587 | 1594 | ||
1588 | if(!strcmp(pb_string, action)) | 1595 | if(!strcmp(pb_string, action)) |
1589 | region->type = WPS_TOUCHREGION_SCROLLBAR; | 1596 | region->type = WPS_TOUCHREGION_SCROLLBAR; |
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index 9c0cda779a..09fbd86acd 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c | |||
@@ -95,6 +95,8 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset) | |||
95 | *edge_offset = vx*100/r->width; | 95 | *edge_offset = vx*100/r->width; |
96 | else | 96 | else |
97 | *edge_offset = vy*100/r->height; | 97 | *edge_offset = vy*100/r->height; |
98 | if (r->reverse_bar) | ||
99 | *edge_offset = 100 - *edge_offset; | ||
98 | } | 100 | } |
99 | returncode = r->type; | 101 | returncode = r->type; |
100 | break; | 102 | break; |
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index 5501dd580b..4ef860a8b7 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h | |||
@@ -228,6 +228,7 @@ struct touchregion { | |||
228 | WPS_TOUCHREGION_SCROLLBAR, | 228 | WPS_TOUCHREGION_SCROLLBAR, |
229 | WPS_TOUCHREGION_VOLUME | 229 | WPS_TOUCHREGION_VOLUME |
230 | } type; /* type of touch region */ | 230 | } type; /* type of touch region */ |
231 | bool reverse_bar; /* if true 0% is the left or top */ | ||
231 | bool repeat; /* requires the area be held for the action */ | 232 | bool repeat; /* requires the area be held for the action */ |
232 | int action; /* action this button will return */ | 233 | int action; /* action this button will return */ |
233 | bool armed; /* A region is armed on press. Only armed regions are triggered | 234 | bool armed; /* A region is armed on press. Only armed regions are triggered |