X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=qml%2Fpages%2FMainPage.qml;h=f5c039772265822c7922d50bb9a4e3d520289c57;hp=5c0c16bdda3d7867c75a938ff70ecdf0abaa8790;hb=ac8b7885c6787ad72b5cf8d422c8e5c8ec0e18fb;hpb=5fc520bad80dccf9bf2e0f16552c9f2605417067 diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 5c0c16b..f5c0397 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -1,5 +1,6 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import "../components" Page { id: page @@ -19,29 +20,26 @@ Page { text: qsTr("About") onClicked: pageStack.push(Qt.resolvedUrl("About.qml")) } + + MenuItem { + text: qsTr("The Pedalo Rules") + onClicked: pageStack.push(Qt.resolvedUrl("TheRules.qml")) + } } // Tell SilicaFlickable the height of its content. - contentHeight: column.implicitHeight + Theme.paddingLarge + contentHeight: column.implicitHeight - // 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!") - } + width: isPortrait ? parent.width : parent.width / 2.0 + height: isPortrait ? page.height / 2.0 : page.height + spacing: 0 - Button { - anchors.horizontalCenter: parent.horizontalCenter - text: currentStatus.cycling ? qsTr("Finish") : qsTr("Start a journey") + 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()}) @@ -56,36 +54,33 @@ Page { } } - SectionHeader { + BarButton { + source: "image://pedalo/button-journey-add?" + (pressed ? Theme.primaryColor : Theme.highlightColor) 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") - } + 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 - Button { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("View stats") + BarButton { + source: "image://pedalo/button-stats?" + (pressed ? Theme.primaryColor : Theme.highlightColor) + text: qsTr("View latest stats") onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml")) } - SectionHeader { + BarButton { + source: "image://pedalo/button-list?" + (pressed ? Theme.primaryColor : Theme.highlightColor) text: qsTr("Previous journeys") - } - - Button { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("View journeys") onClicked: pageStack.push(Qt.resolvedUrl("JourneyList.qml")) } - } } }