bar: fix battery charging icons
This commit is contained in:
parent
80f2fdf044
commit
e8adf58097
1 changed files with 3 additions and 1 deletions
|
|
@ -87,7 +87,9 @@ Item {
|
||||||
const charging = device.changeRate >= 0;
|
const charging = device.changeRate >= 0;
|
||||||
if (perc === 1)
|
if (perc === 1)
|
||||||
return charging ? "battery_charging_full" : "battery_full";
|
return charging ? "battery_charging_full" : "battery_full";
|
||||||
const level = Math.floor(perc * 7);
|
let level = Math.floor(perc * 7);
|
||||||
|
if (charging && (level === 4 || level === 1))
|
||||||
|
level--;
|
||||||
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
|
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
|
||||||
}
|
}
|
||||||
color: UPower.displayDevice.percentage > 0.2 ? root.colour : Colours.palette.m3error
|
color: UPower.displayDevice.percentage > 0.2 ? root.colour : Colours.palette.m3error
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue