From c6078fe2a889538069ada0a4e1abb92c8aa1a553 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Thu, 12 Aug 2010 09:25:26 +0000 Subject: [PATCH] Slightly change bl (battery level) when used in an enum: if the enum contained 10 items, bl would return 11 if the battery level was 100 percent (the enum would then display the last entry). Now bl returns a value within the given range. Themes may need to be updated to look as intended. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27784 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_tokens.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index fa6a5daedd..ebe9ac50b1 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -655,10 +655,12 @@ const char *get_token_value(struct gui_wps *gwps, if (intval) { - limit = MAX(limit, 2); + limit = MAX(limit, 3); if (l > -1) { - /* First enum is used for "unknown level". */ - *intval = (limit - 1) * l / 100 + 2; + /* First enum is used for "unknown level", + * last enum is used for 100%. + */ + *intval = (limit - 2) * l / 100 + 2; } else { *intval = 1; }