diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-04-19 08:43:42 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-04-19 08:43:42 +0000 |
commit | 58a0393154cfced92830fed1a78450761f30f3b9 (patch) | |
tree | 9f00c8b5779a0d045b5fdd860f0e995b2c593a90 /apps/gui | |
parent | 1cd1e66ed361d908b517d224aab6da0cc8693f1e (diff) | |
download | rockbox-58a0393154cfced92830fed1a78450761f30f3b9.tar.gz rockbox-58a0393154cfced92830fed1a78450761f30f3b9.zip |
2 quick fixes
1) fix %pv| where the | is for a conditional break and not for long form %pv
2) only draw bmp-bars if they are enabled (by a conditional or always on.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25677 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 15 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 8 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 827d90c630..9cef12a690 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -608,6 +608,12 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index) | |||
608 | /* clear all pictures in the conditional and nested ones */ | 608 | /* clear all pictures in the conditional and nested ones */ |
609 | if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY) | 609 | if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY) |
610 | clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, data)); | 610 | clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, data)); |
611 | else if (data->tokens[i].type == WPS_TOKEN_VOLUMEBAR || | ||
612 | data->tokens[i].type == WPS_TOKEN_PROGRESSBAR) | ||
613 | { | ||
614 | struct progressbar *bar = (struct progressbar*)data->tokens[i].value.data; | ||
615 | bar->draw = false; | ||
616 | } | ||
611 | #endif | 617 | #endif |
612 | #ifdef HAVE_ALBUMART | 618 | #ifdef HAVE_ALBUMART |
613 | if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY) | 619 | if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY) |
@@ -670,6 +676,13 @@ static bool get_line(struct gui_wps *gwps, | |||
670 | break; | 676 | break; |
671 | 677 | ||
672 | #ifdef HAVE_LCD_BITMAP | 678 | #ifdef HAVE_LCD_BITMAP |
679 | case WPS_TOKEN_VOLUMEBAR: | ||
680 | case WPS_TOKEN_PROGRESSBAR: | ||
681 | { | ||
682 | struct progressbar *bar = (struct progressbar*)data->tokens[i].value.data; | ||
683 | bar->draw = true; | ||
684 | } | ||
685 | break; | ||
673 | case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: | 686 | case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: |
674 | { | 687 | { |
675 | char n = data->tokens[i].value.i & 0xFF; | 688 | char n = data->tokens[i].value.i & 0xFF; |
@@ -1255,7 +1268,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
1255 | while (bar) | 1268 | while (bar) |
1256 | { | 1269 | { |
1257 | struct progressbar *thisbar = (struct progressbar*)bar->token->value.data; | 1270 | struct progressbar *thisbar = (struct progressbar*)bar->token->value.data; |
1258 | if (thisbar->vp == &skin_viewport->vp) | 1271 | if (thisbar->vp == &skin_viewport->vp && thisbar->draw) |
1259 | { | 1272 | { |
1260 | draw_progressbar(gwps, thisbar); | 1273 | draw_progressbar(gwps, thisbar); |
1261 | } | 1274 | } |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index cac3b381b7..93c5c73210 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -1158,6 +1158,7 @@ static int parse_progressbar(const char *wps_bufptr, | |||
1158 | pb->have_bitmap_pb = false; | 1158 | pb->have_bitmap_pb = false; |
1159 | pb->bm.data = NULL; /* no bitmap specified */ | 1159 | pb->bm.data = NULL; /* no bitmap specified */ |
1160 | pb->follow_lang_direction = follow_lang_direction > 0; | 1160 | pb->follow_lang_direction = follow_lang_direction > 0; |
1161 | pb->draw = false; | ||
1161 | 1162 | ||
1162 | if (*wps_bufptr != '|') /* regular old style */ | 1163 | if (*wps_bufptr != '|') /* regular old style */ |
1163 | { | 1164 | { |
@@ -1174,7 +1175,14 @@ static int parse_progressbar(const char *wps_bufptr, | |||
1174 | 1175 | ||
1175 | if (!(ptr = parse_list("sdddd", &set, '|', ptr, &filename, | 1176 | if (!(ptr = parse_list("sdddd", &set, '|', ptr, &filename, |
1176 | &x, &y, &width, &height))) | 1177 | &x, &y, &width, &height))) |
1178 | { | ||
1179 | /* if we are in a conditional then we probably don't want to fail | ||
1180 | * if the above doesnt work. so ASSume the | is breaking the conditional | ||
1181 | * and move on. the next token will fail if this is incorrect */ | ||
1182 | if (level > 0) | ||
1183 | return 0; | ||
1177 | return WPS_ERROR_INVALID_PARAM; | 1184 | return WPS_ERROR_INVALID_PARAM; |
1185 | } | ||
1178 | 1186 | ||
1179 | if (LIST_VALUE_PARSED(set, PB_FILENAME)) /* filename */ | 1187 | if (LIST_VALUE_PARSED(set, PB_FILENAME)) /* filename */ |
1180 | pb->bm.data = (char*)filename; | 1188 | pb->bm.data = (char*)filename; |
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index 954928085f..a014770017 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h | |||
@@ -105,6 +105,8 @@ struct progressbar { | |||
105 | /*progressbar image*/ | 105 | /*progressbar image*/ |
106 | struct bitmap bm; | 106 | struct bitmap bm; |
107 | bool have_bitmap_pb; | 107 | bool have_bitmap_pb; |
108 | |||
109 | bool draw; | ||
108 | }; | 110 | }; |
109 | #endif | 111 | #endif |
110 | 112 | ||