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
This commit is contained in:
parent
c65a8e0755
commit
c6078fe2a8
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue