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