diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-04-25 11:32:51 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-04-25 11:32:51 +0000 |
commit | 4c65a1970e25ef1b6eaa91f614eef64d0efe5779 (patch) | |
tree | 6d748c7650b42441409f5573161f24c674fd37b1 /apps/gui/skin_engine/skin_display.c | |
parent | cbc65befa8b3fbb53e7e2603f838a79b5fa5fcbc (diff) |
Make battery level (%bl) work with the bmp bars drawer like %pb and %pv
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25710 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 9cef12a690..a0b3497683 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -27,6 +27,7 @@ #include "system.h" #include "rbunicode.h" #include "sound.h" +#include "powermgmt.h" #ifdef DEBUG #include "debug.h" #endif @@ -145,6 +146,11 @@ static void draw_progressbar(struct gui_wps *gwps, 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; @@ -608,8 +614,9 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index) /* clear all pictures in the conditional and nested ones */ if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY) clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, data)); - else if (data->tokens[i].type == WPS_TOKEN_VOLUMEBAR || - data->tokens[i].type == WPS_TOKEN_PROGRESSBAR) + else if (data->tokens[i].type == WPS_TOKEN_VOLUMEBAR || + data->tokens[i].type == WPS_TOKEN_PROGRESSBAR || + data->tokens[i].type == WPS_TOKEN_BATTERY_PERCENTBAR ) { struct progressbar *bar = (struct progressbar*)data->tokens[i].value.data; bar->draw = false; @@ -677,6 +684,7 @@ static bool get_line(struct gui_wps *gwps, #ifdef HAVE_LCD_BITMAP case WPS_TOKEN_VOLUMEBAR: + case WPS_TOKEN_BATTERY_PERCENTBAR: case WPS_TOKEN_PROGRESSBAR: { struct progressbar *bar = (struct progressbar*)data->tokens[i].value.data; |