Commit e5f94796 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Battery level display

parent 0d485740
......@@ -23,6 +23,8 @@ Requires: nemo-qml-plugin-configuration-qt5
Requires: nemo-qml-plugin-time-qt5
Requires: qt5-qtdeclarative-import-window2
Requires: qt5-qtquickcontrols-nemo
Requires: nemo-qml-plugin-contextkit-qt5
Requires: statefs-provider-bme
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(lipstick-qt5) >= 0.12.0
......
......@@ -16,6 +16,8 @@ Requires:
- nemo-qml-plugin-time-qt5
- qt5-qtdeclarative-import-window2 # TODO: components dep?
- qt5-qtquickcontrols-nemo
- nemo-qml-plugin-contextkit-qt5
- statefs-provider-bme
PkgConfigBR:
- Qt5Core
- Qt5Quick
......
......@@ -36,6 +36,7 @@ import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Window 2.1
import org.nemomobile.time 1.0
import org.nemomobile.configuration 1.0
import org.freedesktop.contextkit 1.0
Page {
......@@ -62,7 +63,47 @@ Page {
} else { Qt.quit(); }
}
}
orientation: Qt.PortraitOrientation
Connections {
target: batterystatus
onValueChanged: {
batterylbl.text = "Battery status: " + batterystatus.value
}
}
Connections {
target: onbattery
onValueChanged: {
if (onbattery.value) {
charging.text = "On battery"
} else {
charging.text = "On wall"
}
}
}
ContextProperty {
id: batterystatus
key: "Battery.ChargePercentage"
value: "100"
}
ContextProperty {
id: onbattery
key: "Battery.OnBattery"
}
tools: Item {
Label {
id: batterylbl
font.pointSize: 8
color: "black"
}
Label {
id: charging
font.pointSize: 8
color: "black"
anchors.right: batterylbl.left
}
}
Pager {
id: pager
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment