mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
skin_engine: Clean up %x() handling - beware theme issues
Internally remove some hacks around how %x() is handled. %x() inside the default viewport will no longer work if other viewports are used, so if you are using viewports and %x() make sure it is in a viewport! Change-Id: I8ecab805d55fc0f8476ff0516cba38e23400aa20
This commit is contained in:
parent
0807fe8d36
commit
34031cba5b
7 changed files with 12 additions and 15 deletions
|
@ -298,10 +298,7 @@ void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subimage)
|
|||
{
|
||||
struct screen *display = gwps->display;
|
||||
img->bm.data = core_get_data(img->buflib_handle);
|
||||
if(img->always_display)
|
||||
display->set_drawmode(DRMODE_FG);
|
||||
else
|
||||
display->set_drawmode(DRMODE_SOLID);
|
||||
display->set_drawmode(DRMODE_SOLID);
|
||||
|
||||
display->bmp_part(&img->bm, 0, img->subimage_height * subimage,
|
||||
img->x, img->y, img->bm.width, img->subimage_height);
|
||||
|
@ -331,10 +328,6 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
|
|||
{
|
||||
wps_draw_image(gwps, img, img->display);
|
||||
}
|
||||
else if (img->always_display && SKINOFFSETTOPTR(get_skin_buffer(data), img->vp) == vp)
|
||||
{
|
||||
wps_draw_image(gwps, img, 0);
|
||||
}
|
||||
}
|
||||
list = SKINOFFSETTOPTR(get_skin_buffer(data), list->next);
|
||||
}
|
||||
|
|
|
@ -415,7 +415,6 @@ static int parse_image_load(struct skin_element *element,
|
|||
img->x = x;
|
||||
img->y = y;
|
||||
img->num_subimages = 1;
|
||||
img->always_display = false;
|
||||
img->display = -1;
|
||||
img->using_preloaded_icons = false;
|
||||
img->buflib_handle = -1;
|
||||
|
@ -425,7 +424,7 @@ static int parse_image_load(struct skin_element *element,
|
|||
|
||||
if (token->type == SKIN_TOKEN_IMAGE_DISPLAY)
|
||||
{
|
||||
img->always_display = true;
|
||||
token->value.data = PTRTOSKINOFFSET(skin_buffer, img);
|
||||
}
|
||||
else if (element->params_count == 5)
|
||||
{
|
||||
|
@ -1000,7 +999,6 @@ static int parse_progressbar_tag(struct skin_element* element,
|
|||
img->x = 0;
|
||||
img->y = 0;
|
||||
img->num_subimages = 1;
|
||||
img->always_display = false;
|
||||
img->display = -1;
|
||||
img->using_preloaded_icons = false;
|
||||
img->buflib_handle = -1;
|
||||
|
|
|
@ -198,6 +198,13 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
|
|||
#endif
|
||||
break;
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
case SKIN_TOKEN_IMAGE_DISPLAY:
|
||||
{
|
||||
struct gui_img *img = SKINOFFSETTOPTR(skin_buffer, token->value.data);
|
||||
if (img && img->loaded && do_refresh)
|
||||
img->display = 0;
|
||||
}
|
||||
break;
|
||||
case SKIN_TOKEN_IMAGE_DISPLAY_LISTICON:
|
||||
case SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY:
|
||||
{
|
||||
|
|
|
@ -80,7 +80,6 @@ struct gui_img {
|
|||
int buflib_handle;
|
||||
OFFSETTYPE(char*) label;
|
||||
bool loaded; /* load state */
|
||||
bool always_display; /* not using the preload/display mechanism */
|
||||
int display;
|
||||
bool using_preloaded_icons; /* using the icon system instead of a bmp */
|
||||
};
|
||||
|
|
|
@ -178,7 +178,7 @@ static const struct tag_info legal_tags[] =
|
|||
|
||||
{ SKIN_TOKEN_IMAGE_PRELOAD, "xl", "SFII|I", 0|NOBREAK },
|
||||
{ SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, "xd", "S|[IT]I", 0 },
|
||||
{ SKIN_TOKEN_IMAGE_DISPLAY, "x", "SFII", 0|NOBREAK },
|
||||
{ SKIN_TOKEN_IMAGE_DISPLAY, "x", "SFII", SKIN_REFRESH_STATIC|NOBREAK },
|
||||
|
||||
{ SKIN_TOKEN_LOAD_FONT, "Fl" , "IF|I", 0|NOBREAK },
|
||||
{ SKIN_TOKEN_ALBUMART_LOAD, "Cl" , "IIII|ss", 0|NOBREAK },
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
%wd
|
||||
#
|
||||
# Load Backdrop
|
||||
%V(0,0,-,-,-)
|
||||
%x(z,wpsbackdrop-112x64x1.bmp,0,0)
|
||||
#
|
||||
# Preload Images
|
||||
|
|
|
@ -11,12 +11,11 @@
|
|||
%xl(D,shuffle-128x64x1.bmp,0,1)
|
||||
%xl(E,repeat-128x64x1.bmp,0,0,4)
|
||||
%xl(F,playmode-128x64x1.bmp,0,0,5)
|
||||
%x(a,pbbackground-128x64x1.bmp,1,0)
|
||||
%xl(b,bar-128x64x1.bmp,2,0)
|
||||
#
|
||||
# Progress Bar
|
||||
%V(0,0,128,6,1)
|
||||
#%xd(a)
|
||||
%x(a,pbbackground-128x64x1.bmp,1,0)
|
||||
%pb(2,1,123,4,pb-128x64x1.bmp)
|
||||
#
|
||||
# Separator Bar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue