lock: fix battery percentage (#340)

This commit is contained in:
kanlaric 2025-08-04 17:36:01 +03:00 committed by GitHub
parent 1f4ec53f8f
commit 6ae451413d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,7 @@ WrapperItem {
sourceComponent: StyledText {
animate: true
text: qsTr("%1%2 remaining").arg(UPower.onBattery ? "" : "(+) ").arg(UPower.displayDevice.percentage)
text: qsTr("%1%2% remaining").arg(UPower.onBattery ? "" : "(+) ").arg(Math.round(UPower.displayDevice.percentage * 100))
color: !UPower.onBattery || UPower.displayDevice.percentage > 0.2 ? Colours.palette.m3onSurface : Colours.palette.m3error
}
}