Icons: WIP using a proper mapping table
This commit is contained in:
parent
8da2cdf430
commit
a4107c87c0
41 changed files with 2277 additions and 183 deletions
|
|
@ -10,20 +10,20 @@ Singleton {
|
|||
// Choose icon based on charge and charging state
|
||||
function getIcon(percent, charging, isReady) {
|
||||
if (!isReady) {
|
||||
return FontService.icons["battery_empty"] // FIXME: find battery error ?
|
||||
return Bootstrap.icons["battery_empty"] // FIXME: find battery error ?
|
||||
}
|
||||
|
||||
if (charging) {
|
||||
return FontService.icons["battery_charging"]
|
||||
return Bootstrap.icons["battery_charging"]
|
||||
} else {
|
||||
if (percent >= 85)
|
||||
return FontService.icons["battery_full"]
|
||||
return Bootstrap.icons["battery_full"]
|
||||
if (percent >= 45)
|
||||
return FontService.icons["battery_half"]
|
||||
return Bootstrap.icons["battery_half"]
|
||||
if (percent >= 25)
|
||||
return FontService.icons["battery_low"]
|
||||
return Bootstrap.icons["battery_low"]
|
||||
if (percent >= 0)
|
||||
return FontService.icons["battery_empty"]
|
||||
return Bootstrap.icons["battery_empty"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue