Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: apps/gui/skin_engine/skin_parser.c
- ===================================================================
- --- apps/gui/skin_engine/skin_parser.c (revision 25643)
- +++ apps/gui/skin_engine/skin_parser.c (working copy)
- @@ -202,7 +202,7 @@
- { WPS_TOKEN_ALIGN_RIGHT_RTL, "aR", 0, NULL },
- { WPS_NO_TOKEN, "ax", 0, parse_languagedirection },
- - { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, NULL },
- + { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, parse_progressbar },
- { WPS_TOKEN_BATTERY_VOLTS, "bv", WPS_REFRESH_DYNAMIC, NULL },
- { WPS_TOKEN_BATTERY_TIME, "bt", WPS_REFRESH_DYNAMIC, NULL },
- { WPS_TOKEN_BATTERY_SLEEPTIME, "bs", WPS_REFRESH_DYNAMIC, NULL },
- @@ -1164,7 +1164,7 @@
- pb->width = vp->width;
- pb->height = SYSFONT_HEIGHT-2;
- pb->y = -line_num - 1; /* Will be computed during the rendering */
- - if (token->type == WPS_TOKEN_VOLUME)
- + if (token->type == WPS_TOKEN_VOLUME || token->type == WPS_TOKEN_BATTERY_PERCENT)
- return 0; /* dont add it, let the regular token handling do the work */
- add_to_ll_chain(&wps_data->progressbars, item);
- return 0;
- @@ -1224,6 +1224,8 @@
- add_to_ll_chain(&wps_data->progressbars, item);
- if (token->type == WPS_TOKEN_VOLUME)
- token->type = WPS_TOKEN_VOLUMEBAR;
- + else if (token->type == WPS_TOKEN_BATTERY_PERCENT)
- + token->type = WPS_TOKEN_BATTERY_PERCENTBAR;
- pb->type = token->type;
- return ptr+1-wps_bufptr;
- Index: apps/gui/skin_engine/skin_display.c
- ===================================================================
- --- apps/gui/skin_engine/skin_display.c (revision 25643)
- +++ apps/gui/skin_engine/skin_display.c (working copy)
- @@ -145,6 +145,11 @@
- length = maxvol-minvol;
- elapsed = global_settings.volume-minvol;
- }
- + else if (pb->type == WPS_TOKEN_BATTERY_PERCENTBAR)
- + {
- + length = 100;
- + elapsed = battery_level();
- + }
- else if (id3 && id3->length)
- {
- length = id3->length;
- Index: apps/gui/skin_engine/skin_tokens.h
- ===================================================================
- --- apps/gui/skin_engine/skin_tokens.h (revision 25643)
- +++ apps/gui/skin_engine/skin_tokens.h (working copy)
- @@ -59,6 +59,7 @@
- /* Battery */
- TOKEN_MARKER_BATTERY,
- WPS_TOKEN_BATTERY_PERCENT,
- + WPS_TOKEN_BATTERY_PERCENTBAR,
- WPS_TOKEN_BATTERY_VOLTS,
- WPS_TOKEN_BATTERY_TIME,
- WPS_TOKEN_BATTERY_CHARGER_CONNECTED,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement