summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_touchsupport.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-06-24 21:52:18 +1000
committerJonathan Gordon <rockbox@jdgordon.info>2012-07-05 11:15:16 +1000
commitd336eb30f8098f4a8f0bc27dc40358b30e57decd (patch)
tree93d840e7096edf21469f6b4110ae7f49cab09c90 /apps/gui/skin_engine/skin_touchsupport.c
parent3d0459dfadf0071112cd8406b9c210123b667e03 (diff)
skin_engine: Automatically create touch regions for skin bars
skin bars now automatically create the touch region the same size as the bar on touchscreen targets. This means touches will magically "just work" for reveresed bars (rtl or otherwise). ~5% padding is added on all 4 sides of the region rectangle but this may need to be tweaked. Please consider the 'progressbar' and 'volume' touchregion actions to be deprecated. Kudos to my new wife for figuring out the bleedingly obvious way to do this! Change-Id: I997a7bcaa70fce9885808aae27953c7676e9c2ff
Diffstat (limited to 'apps/gui/skin_engine/skin_touchsupport.c')
-rw-r--r--apps/gui/skin_engine/skin_touchsupport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c
index 34f616b9a3..f685cd0b70 100644
--- a/apps/gui/skin_engine/skin_touchsupport.c
+++ b/apps/gui/skin_engine/skin_touchsupport.c
@@ -99,7 +99,6 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
/* reposition the touch within the area */
vx -= r->x;
vy -= r->y;
-
switch(r->action)
{
@@ -107,11 +106,13 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
case ACTION_TOUCH_VOLUME:
if (edge_offset)
{
+ struct progressbar *bar =
+ SKINOFFSETTOPTR(skin_buffer, r->bar);
if(r->width > r->height)
*edge_offset = vx*100/r->width;
else
*edge_offset = vy*100/r->height;
- if (r->reverse_bar)
+ if (r->reverse_bar || (bar && bar->invert_fill_direction))
*edge_offset = 100 - *edge_offset;
}
temp = r;