summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2012-02-21 14:33:42 +0100
committerFrank Gevaerts <frank@gevaerts.be>2012-02-22 01:15:42 +0100
commit680c6fcde1eabb45dd12c59718d708b2cda61f6a (patch)
tree6dbb5ff39f5ade24a079c84114cea40a29d3ab67
parenta16b65e47d2a972c4fee955647439d22bdb8ce11 (diff)
downloadrockbox-680c6fcde1eabb45dd12c59718d708b2cda61f6a.tar.gz
rockbox-680c6fcde1eabb45dd12c59718d708b2cda61f6a.zip
Store listitem_viewport_cfg->label as skinoffset instead of raw pointer
This fixes the case where some blocks got relocated and the skin render code couldn't find the matching viewports any more. Change-Id: I4394444fb139ee5bc986f374dba82a104013e354 Reviewed-on: http://gerrit.rockbox.org/112 Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
-rw-r--r--apps/gui/bitmap/list-skinned.c2
-rw-r--r--apps/gui/list.h2
-rw-r--r--apps/gui/skin_engine/skin_parser.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/gui/bitmap/list-skinned.c b/apps/gui/bitmap/list-skinned.c
index 672a1e90e3..028374cf12 100644
--- a/apps/gui/bitmap/list-skinned.c
+++ b/apps/gui/bitmap/list-skinned.c
@@ -165,7 +165,7 @@ bool skinlist_draw(struct screen *display, struct gui_synclist *list)
wps.display = display;
wps.data = listcfg[screen]->data;
display_lines = skinlist_get_line_count(screen, list);
- label = listcfg[screen]->label;
+ label = (char *)SKINOFFSETTOPTR(get_skin_buffer(wps.data), listcfg[screen]->label);
display->set_viewport(parent);
display->clear_viewport();
current_item = list->selected_item;
diff --git a/apps/gui/list.h b/apps/gui/list.h
index d9df008956..41bc4369d1 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -180,7 +180,7 @@ extern bool gui_synclist_do_button(struct gui_synclist * lists,
#if defined(HAVE_LCD_BITMAP) && !defined(PLUGIN)
struct listitem_viewport_cfg {
struct wps_data *data;
- char* label;
+ OFFSETTYPE(char *) label;
int width;
int height;
int xmargin;
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 8409f0ed8b..3899f605f3 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -577,7 +577,7 @@ static int parse_listitemviewport(struct skin_element *element,
return -1;
cfg->data = wps_data;
cfg->tile = false;
- cfg->label = get_param_text(element, 0);
+ cfg->label = PTRTOSKINOFFSET(skin_buffer, get_param_text(element, 0));
cfg->width = -1;
cfg->height = -1;
if (!isdefault(get_param(element, 1)))