internal: fix battery charging logic for tray and lock (#751)
* Update StatusIcons.qml --- Fix battery chargiing logic idk what the difference is in the return value of UPower.onBattery and UPower.displayDevice.state, but the former always returns false after unplugging my laptop. Changing this to the more specific displayDevice.state === 2 fixes this * Fetch.qml --- Fix battery charging boolean logic * Use enum value for UPowerDeviceState instead of index * Use enum value for UPowerDeviceState instead of index * Update Fetch.qml --- invert battery conditional logic
This commit is contained in:
parent
555539d504
commit
90c051cfa1
2 changed files with 2 additions and 2 deletions
|
|
@ -235,7 +235,7 @@ StyledRect {
|
|||
}
|
||||
|
||||
const perc = UPower.displayDevice.percentage;
|
||||
const charging = !UPower.onBattery;
|
||||
const charging = UPower.displayDevice.state === UPowerDeviceState.Charging;
|
||||
if (perc === 1)
|
||||
return charging ? "battery_charging_full" : "battery_full";
|
||||
let level = Math.floor(perc * 7);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ ColumnLayout {
|
|||
active: UPower.displayDevice.isLaptopBattery
|
||||
|
||||
sourceComponent: FetchText {
|
||||
text: `BATT: ${UPower.onBattery ? "" : "(+) "}${Math.round(UPower.displayDevice.percentage * 100)}%`
|
||||
text: `BATT: ${UPower.displayDevice.state === UPowerDeviceState.Charging ? "(+) " : ""}${Math.round(UPower.displayDevice.percentage * 100)}%`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue