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>
This commit is contained in:
Frank Gevaerts 2012-02-21 14:33:42 +01:00
parent a16b65e47d
commit 680c6fcde1
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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)))