fix: no battery icon unless actually have battery

This commit is contained in:
2025-12-28 00:06:34 +00:00
parent 75ef6f9085
commit bd20dc584f

View File

@@ -15,13 +15,7 @@ Rectangle {
property int battPercent: 58
implicitWidth: itemContent.width + 8
implicitHeight: 24
enabled: {
if (UPower.displayDevice != null) {
true
} else {
false
}
}
visible: {if (UPower.displayDevice.ready) { true } else {false}}
radius: 5.5
Layout.alignment: Qt.AlignVCenter
color: "#2a2a2a" // Define item color
@@ -32,7 +26,7 @@ Rectangle {
anchors.centerIn: parent
Text {
// anchors.centerIn: parent
text: "58%"
text: UPower.displayDevice.percentage + "%"
color: Common.Colors.colors.primary
font.weight: Font.DemiBold
font.pointSize: 12