summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index eb63ac56e9..6ea0180534 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -202,7 +202,7 @@ static const struct wps_tag all_tags[] = {
202 { WPS_TOKEN_ALIGN_RIGHT_RTL, "aR", 0, NULL }, 202 { WPS_TOKEN_ALIGN_RIGHT_RTL, "aR", 0, NULL },
203 { WPS_NO_TOKEN, "ax", 0, parse_languagedirection }, 203 { WPS_NO_TOKEN, "ax", 0, parse_languagedirection },
204 204
205 { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, NULL }, 205 { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, parse_progressbar },
206 { WPS_TOKEN_BATTERY_VOLTS, "bv", WPS_REFRESH_DYNAMIC, NULL }, 206 { WPS_TOKEN_BATTERY_VOLTS, "bv", WPS_REFRESH_DYNAMIC, NULL },
207 { WPS_TOKEN_BATTERY_TIME, "bt", WPS_REFRESH_DYNAMIC, NULL }, 207 { WPS_TOKEN_BATTERY_TIME, "bt", WPS_REFRESH_DYNAMIC, NULL },
208 { WPS_TOKEN_BATTERY_SLEEPTIME, "bs", WPS_REFRESH_DYNAMIC, NULL }, 208 { WPS_TOKEN_BATTERY_SLEEPTIME, "bs", WPS_REFRESH_DYNAMIC, NULL },
@@ -1166,7 +1166,7 @@ static int parse_progressbar(const char *wps_bufptr,
1166 pb->width = vp->width; 1166 pb->width = vp->width;
1167 pb->height = SYSFONT_HEIGHT-2; 1167 pb->height = SYSFONT_HEIGHT-2;
1168 pb->y = -line_num - 1; /* Will be computed during the rendering */ 1168 pb->y = -line_num - 1; /* Will be computed during the rendering */
1169 if (token->type == WPS_TOKEN_VOLUME) 1169 if (token->type == WPS_TOKEN_VOLUME || token->type == WPS_TOKEN_BATTERY_PERCENT)
1170 return 0; /* dont add it, let the regular token handling do the work */ 1170 return 0; /* dont add it, let the regular token handling do the work */
1171 add_to_ll_chain(&wps_data->progressbars, item); 1171 add_to_ll_chain(&wps_data->progressbars, item);
1172 return 0; 1172 return 0;
@@ -1233,12 +1233,15 @@ static int parse_progressbar(const char *wps_bufptr,
1233 add_to_ll_chain(&wps_data->progressbars, item); 1233 add_to_ll_chain(&wps_data->progressbars, item);
1234 if (token->type == WPS_TOKEN_VOLUME) 1234 if (token->type == WPS_TOKEN_VOLUME)
1235 token->type = WPS_TOKEN_VOLUMEBAR; 1235 token->type = WPS_TOKEN_VOLUMEBAR;
1236 else if (token->type == WPS_TOKEN_BATTERY_PERCENT)
1237 token->type = WPS_TOKEN_BATTERY_PERCENTBAR;
1236 pb->type = token->type; 1238 pb->type = token->type;
1237 1239
1238 return ptr+1-wps_bufptr; 1240 return ptr+1-wps_bufptr;
1239#else 1241#else
1240 (void)wps_bufptr; 1242 (void)wps_bufptr;
1241 if (token->type != WPS_TOKEN_VOLUME) 1243 if (token->type != WPS_TOKEN_VOLUME &&
1244 token->type != WPS_TOKEN_BATTERY_PERCENTBAR)
1242 { 1245 {
1243 wps_data->full_line_progressbar = 1246 wps_data->full_line_progressbar =
1244 token->type == WPS_TOKEN_PLAYER_PROGRESSBAR; 1247 token->type == WPS_TOKEN_PLAYER_PROGRESSBAR;