Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Mikhaylenko
35aa7998bc 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
2019-09-14 12:17:46 +05:00

View File

@ -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`;