Add MyDetailItem

This commit is contained in:
Matti Viljanen 2019-01-29 01:23:53 +02:00
parent c7ba509bc7
commit 99d8aecb7a
No known key found for this signature in database
GPG key ID: CF32A1495158F888
2 changed files with 20 additions and 5 deletions

View file

@ -32,7 +32,8 @@ DISTFILES += qml/harbour-batterybuddy.qml \
qml/pages/AboutPage.qml \
qml/pages/InfoPage.qml \
rpm/harbour-batterybuddy.changes \
qml/components/BatteryGraph.qml
qml/components/BatteryGraph.qml \
qml/components/MyDetailItem.qml
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172

View file

@ -19,6 +19,7 @@ import QtQuick 2.0
import QtMultimedia 5.6
import Sailfish.Silica 1.0
import Nemo.Notifications 1.0
import "../components"
Page {
id: page
@ -121,10 +122,23 @@ Page {
+(battery.charging ? qsTr("yes") : qsTr("no"))+"\n"
+statusText[battery.state]
}
Label {
x: Theme.paddingLarge
text: qsTr("Alert levels")
color: Theme.highlightColor
// Detail column
Column {
width: parent.width
spacing: 0
MyDetailItem {
label: qsTr("Charge:")
value: battery.charge + "%"
}
MyDetailItem {
label: qsTr("Charging:")
value: battery.charging ? qsTr("yes") : qsTr("no")
}
MyDetailItem {
label: qsTr("State:")
value: statusText[battery.state]
}
}
Label {
x: Theme.paddingLarge*2