Display battery state

This commit is contained in:
Matti Viljanen 2019-01-08 20:18:25 +02:00
parent 7ef7775c89
commit ad28b2e402
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -106,13 +106,14 @@ Page {
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeMedium
}
Label {
x: Theme.paddingLarge*2
width: parent.width - x*2;
wrapMode: Text.Wrap
text: qsTr("Charge level") + " " + battery.charge + "%, " + (battery.charging ? qsTr("charging") : qsTr("discharging"))
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeSmall
DetailItem {
//pixelSize: Theme.fontSizeMedium
label: qsTr("Charge level:")+"\n"
+qsTr("Charging:")+"\n"
+qsTr("Battery state:")
value: battery.charge+"%\n"
+(battery.charging ? qsTr("yes") : qsTr("no"))+"\n"
+qsTr(battery.state)
}
Label {
x: Theme.paddingLarge