2 import Sailfish.Silica 1.0
8 // The effective value will be restricted by ApplicationWindow.allowedOrientations
9 allowedOrientations: Orientation.All
11 // To enable PullDownMenu, place our content in a SilicaFlickable
15 VerticalScrollDecorator {}
17 // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
21 onClicked: pageStack.push(Qt.resolvedUrl("About.qml"))
25 text: qsTr("The Pedalo Rules")
26 onClicked: pageStack.push(Qt.resolvedUrl("TheRules.qml"))
30 // Tell SilicaFlickable the height of its content.
31 contentHeight: column.implicitHeight
36 width: isPortrait ? parent.width : parent.width / 2.0
37 height: isPortrait ? page.height / 2.0 : page.height
41 source: (currentStatus.cycling ? "image://pedalo/button-journey-finish?" : "image://pedalo/button-journey-start?") + (pressed ? Theme.primaryColor : Theme.highlightColor)
42 text: currentStatus.cycling ? qsTr("Finish your journey") : qsTr("Start a journey")
44 if (currentStatus.cycling) {
45 var dialog = pageStack.push(Qt.resolvedUrl("JourneyEdit.qml"), {title: "Finish journey", start: journeymodel.epochToDateTime(currentStatus.startTime), duration: currentStatus.getDuration()})
47 dialog.accepted.connect(function() {
48 currentStatus.cycling = false
52 currentStatus.startJourney()
58 source: "image://pedalo/button-journey-add?" + (pressed ? Theme.primaryColor : Theme.highlightColor)
59 text: qsTr("Add a journey")
60 onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml"))
67 width: isPortrait ? parent.width : parent.width / 2.0
68 height: isPortrait ? page.height / 2.0 : page.height
70 y: isPortrait ? page.height / 2: 0
71 x: isPortrait ? 0 : page.width / 2.0
74 source: "image://pedalo/button-stats?" + (pressed ? Theme.primaryColor : Theme.highlightColor)
75 text: qsTr("View latest stats")
76 onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml"))
80 source: "image://pedalo/button-list?" + (pressed ? Theme.primaryColor : Theme.highlightColor)
81 text: qsTr("Previous journeys")
82 onClicked: pageStack.push(Qt.resolvedUrl("JourneyList.qml"))