battery-wid

This commit is contained in:
Zacharias-Brohn
2026-02-11 16:05:31 +01:00
parent 23f9b6a6cb
commit fc3a226b7d
2 changed files with 12 additions and 8 deletions
+2 -8
View File
@@ -12,16 +12,10 @@ Item {
anchors.top: parent.top
anchors.bottom: parent.bottom
function findDevice() {
for ( let i = 0; i < UPower.devices.count; i++ ) {
if ( UPower.devices[i].isLaptopBattery ) {
return UPower.devices[i];
}
}
}
Component.onCompleted: UPower.findDevice()
CustomText {
text: findDevice().percentage
text: UPower.batteryDevice.percentage + "%"
anchors.centerIn: parent
}
}