From 35aa7998bc597133a4bbd369d4a423924e20937d Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Sat, 14 Sep 2019 12:10:40 +0500 Subject: [PATCH] power: Ceil percentage when looking for icon 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 --- js/ui/status/power.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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`;