summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2010-08-12 09:25:26 +0000
committerMagnus Holmgren <magnushol@gmail.com>2010-08-12 09:25:26 +0000
commitc6078fe2a889538069ada0a4e1abb92c8aa1a553 (patch)
tree316fadd575cd9565f7178c26ed4fc041b5a9661a /apps/gui
parentc65a8e07552711f6a62bcdc195adbf9ff0345c0e (diff)
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
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c8
1 files 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;
}