fix bug in Bat.qml

This commit is contained in:
lucy 2026-08-19 23:36:03 +02:00
commit 12c8517e58
2 changed files with 62 additions and 4 deletions

View file

@ -29,8 +29,8 @@ Rectangle {
implicitWidth: batLayout.implicitWidth + 16
radius: Config.rounding
function batteryIcon(percent, charging) {
if (charging)
function batteryIcon(percent) {
if (root.charging)
return "battery_android_frame_bolt";
if (percent <= 15)
return "battery_android_alert";
@ -42,14 +42,14 @@ Rectangle {
return "battery_android_frame_4";
if (percent <= 85)
return "battery_android_frame_5";
if (percent <= 95)
if (percent <= 100)
return "battery_android_frame_full";
}
RowLayout {
id: batLayout
anchors.centerIn: root
MaterialIcon {
text: root.batteryIcon(root.percent, root.charging)
text: root.batteryIcon(root.percent)
}
StyledText {
text: Math.floor(root.percent) + "%"