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 VerticalScrollDecorator {} // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView PullDownMenu { MenuItem { text: qsTr("About") onClicked: pageStack.push(Qt.resolvedUrl("About.qml")) } } // Tell SilicaFlickable the height of its content. contentHeight: column.implicitHeight + Theme.paddingLarge // 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("Pedalo") } SectionHeader { text: qsTr("Cycle!") } Button { anchors.horizontalCenter: parent.horizontalCenter text: currentStatus.cycling ? qsTr("Finish") : qsTr("Start a journey") onClicked: { if (currentStatus.cycling) { var dialog = pageStack.push(Qt.resolvedUrl("JourneyEdit.qml"), {title: "Finish journey", start: journeymodel.epochToDateTime(currentStatus.startTime), duration: currentStatus.getDuration()}) dialog.accepted.connect(function() { currentStatus.cycling = false }) } else { currentStatus.startJourney() } } } SectionHeader { text: qsTr("Add a journey") } Button { anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Enter journey") onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml")) } SectionHeader { text: qsTr("Latest stats") } Button { anchors.horizontalCenter: parent.horizontalCenter text: qsTr("View stats") onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml")) } SectionHeader { text: qsTr("Previous journeys") } Button { anchors.horizontalCenter: parent.horizontalCenter text: qsTr("View journeys") onClicked: pageStack.push(Qt.resolvedUrl("JourneyList.qml")) } } } }