harbour-batterybuddy/qml/pages/MainPage.qml
2019-01-05 20:16:04 +02:00

44 lines
1.2 KiB
QML

import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
id: page
// The effective value will be restricted by ApplicationWindow.allowedOrientations
allowedOrientations: Orientation.All
// To enable PullDownMenu, place our content in a SilicaFlickable
SilicaFlickable {
anchors.fill: parent
// Tell SilicaFlickable the height of its content.
contentHeight: column.height
PullDownMenu {
MenuItem {
text: qsTr("About...")
onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
}
}
// Place our content in a Column. The PageHeader is always placed at the top
// of the page, followed by our content.
Column {
id: column
width: page.width
spacing: Theme.paddingLarge
PageHeader {
title: qsTr("Battery Buddy")
}
DetailItem {
label: qsTr("Charge level")
value: battery.charge;
}
DetailItem {
label: qsTr("Charging")
value: battery.charging ? "yes" : "no";
}
}
}
}