summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <exalm7659@gmail.com>2019-09-14 12:10:40 +0500
committerAlexander Mikhaylenko <exalm7659@gmail.com>2019-09-14 12:17:46 +0500
commit35aa7998bc597133a4bbd369d4a423924e20937d (patch)
tree9dd75393d163fa4420343e2065f7fd15e263914d
parent314a89a8375572b2e23d0ca9efe3a8f8d7b78f9c (diff)
downloadgnome-shell-wip/exalm/battery.tar.gz
power: Ceil percentage when looking for iconwip/exalm/battery
Use correct battery icon. For example, use battery-level-10-symbolic, with a warning, on 1%-10% instead of 10%-19%. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1617 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/726
-rw-r--r--js/ui/status/power.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 486a7fdd3..aa6080d0d 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -110,7 +110,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
// The icons
let chargingState = this._proxy.State == UPower.DeviceState.CHARGING
? '-charging' : '';
- let fillLevel = 10 * Math.floor(this._proxy.Percentage / 10);
+ let fillLevel = 10 * Math.ceil(this._proxy.Percentage / 10);
let icon = this._proxy.State == UPower.DeviceState.FULLY_CHARGED
? 'battery-level-100-charged-symbolic'
: `battery-level-${fillLevel}${chargingState}-symbolic`;