mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-06 21:25:03 -05:00
skin engine: Fix some user-created touch regions being suppressed
Fix the heuristic used for detecting a touch-enabled theme. The old method assumes that volume bar and progress bar tags are always auto-created, but this might not be true. Instead, mark regions that originate from a %T tag as user-created and check for those. Change-Id: Iec732d299a2b4e298bef8069a68ff94e3b642703
This commit is contained in:
parent
1816667937
commit
e3e0c7b73c
2 changed files with 4 additions and 2 deletions
|
|
@ -1294,6 +1294,7 @@ static int parse_progressbar_tag(struct skin_element* element,
|
||||||
region->wvp = PTRTOSKINOFFSET(skin_buffer, curr_vp);
|
region->wvp = PTRTOSKINOFFSET(skin_buffer, curr_vp);
|
||||||
region->reverse_bar = false;
|
region->reverse_bar = false;
|
||||||
region->allow_while_locked = false;
|
region->allow_while_locked = false;
|
||||||
|
region->user_region = false;
|
||||||
region->press_length = PRESS;
|
region->press_length = PRESS;
|
||||||
region->last_press = -1;
|
region->last_press = -1;
|
||||||
region->bar = PTRTOSKINOFFSET(skin_buffer, pb);
|
region->bar = PTRTOSKINOFFSET(skin_buffer, pb);
|
||||||
|
|
@ -1797,6 +1798,7 @@ static int parse_touchregion(struct skin_element *element,
|
||||||
region->last_press = -1;
|
region->last_press = -1;
|
||||||
region->press_length = PRESS;
|
region->press_length = PRESS;
|
||||||
region->allow_while_locked = false;
|
region->allow_while_locked = false;
|
||||||
|
region->user_region = true;
|
||||||
region->bar = PTRTOSKINOFFSET(skin_buffer, NULL);
|
region->bar = PTRTOSKINOFFSET(skin_buffer, NULL);
|
||||||
|
|
||||||
action = get_param_text(element, p++);
|
action = get_param_text(element, p++);
|
||||||
|
|
@ -2721,8 +2723,7 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
|
||||||
struct touchregion *r = NULL;
|
struct touchregion *r = NULL;
|
||||||
if (token)
|
if (token)
|
||||||
r = SKINOFFSETTOPTR(skin_buffer, token->value.data);
|
r = SKINOFFSETTOPTR(skin_buffer, token->value.data);
|
||||||
if (r && r->action != ACTION_TOUCH_SCROLLBAR &&
|
if (r && r->user_region)
|
||||||
r->action != ACTION_TOUCH_VOLUME)
|
|
||||||
{
|
{
|
||||||
user_touch_region_found = true;
|
user_touch_region_found = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,7 @@ struct touchregion {
|
||||||
int16_t hpad; /* padding to height */
|
int16_t hpad; /* padding to height */
|
||||||
bool reverse_bar; /* if true 0% is the left or top */
|
bool reverse_bar; /* if true 0% is the left or top */
|
||||||
bool allow_while_locked;
|
bool allow_while_locked;
|
||||||
|
bool user_region; /* if true this is a user-defined region */
|
||||||
enum {
|
enum {
|
||||||
PRESS, /* quick press only */
|
PRESS, /* quick press only */
|
||||||
LONG_PRESS, /* Long press without repeat */
|
LONG_PRESS, /* Long press without repeat */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue