import QtQuick 2.0 import Sailfish.Silica 1.0 import "../components" 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 Column { id: column width: isPortrait ? parent.width : parent.width / 2.0 height: isPortrait ? page.height / 2.0 : page.height spacing: 0 BarButton { source: (currentStatus.cycling ? "image://pedalo/button-journey-finish?" : "image://pedalo/button-journey-start?") + (pressed ? Theme.primaryColor : Theme.highlightColor) text: currentStatus.cycling ? qsTr("Finish your journey") : 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() } } } BarButton { source: "image://pedalo/button-journey-add?" + (pressed ? Theme.primaryColor : Theme.highlightColor) text: "Add a journey" onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml")) } } Column { id: column2 width: isPortrait ? parent.width : parent.width / 2.0 height: isPortrait ? page.height / 2.0 : page.height spacing: 0 y: isPortrait ? page.height / 2: 0 x: isPortrait ? 0 : page.width / 2.0 BarButton { source: "image://pedalo/button-stats?" + (pressed ? Theme.primaryColor : Theme.highlightColor) text: "View latest stats" onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml")) } BarButton { source: "image://pedalo/button-list?" + (pressed ? Theme.primaryColor : Theme.highlightColor) text: "Previous journeys" onClicked: pageStack.push(Qt.resolvedUrl("JourneyList.qml")) } } } }