1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

Fix display of the status of multiple batteries

When there are several batteries, one of them is fully charged, and the other is discharging, this leads to the incorrect display of the overall status as “Charging”
This commit is contained in:
Oleksandr
2025-11-04 07:22:26 +02:00
committed by GitHub
parent 7c9e9e1cd9
commit e1f06b7139

View File

@@ -51,7 +51,7 @@ Singleton {
}
return Math.round((batteryEnergy * 100) / batteryCapacity)
}
readonly property bool isCharging: batteryAvailable && batteries.some(b => b.state === UPowerDeviceState.Charging || b.state === UPowerDeviceState.FullyCharged)
readonly property bool isCharging: batteryAvailable && batteries.some(b => b.state === UPowerDeviceState.Charging)
// Is the system plugged in (none of the batteries are discharging or empty)
readonly property bool isPluggedIn: batteryAvailable && batteries.every(b => b.state !== UPowerDeviceState.Discharging)