qml/pages/DurationEditDialog.qml \
qml/components/InfoRow.qml \
qml/pages/JourneyEdit.qml \
- qml/pages/JourneyInfo.qml
+ qml/pages/JourneyInfo.qml \
+ qml/components/BarButton.qml
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 256x256
--- /dev/null
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+MouseArea {
+ id: cycleButton
+ property alias source: image.source
+ property alias text: label.text
+
+ width: parent.width
+ height: parent.height / 2
+
+ Rectangle {
+ id: verticalback
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ color: cycleButton.pressed ? Theme.highlightColor : Theme.secondaryHighlightColor
+ }
+
+ Rectangle {
+ id: horizontalback
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ color: cycleButton.pressed ? Theme.highlightColor : Theme.secondaryHighlightColor
+ }
+
+ Label {
+ id: label
+ text: ""
+ font.pixelSize: Theme.fontSizeLarge
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.topMargin: Theme.paddingMedium
+ anchors.rightMargin: Theme.horizontalPageMargin
+ width: parent.width - image.width
+ horizontalAlignment: Text.AlignRight
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ }
+
+ Image {
+ id: image
+ source: ""
+ anchors.left: parent.left
+ fillMode: Image.PreserveAspectFit
+ width: parent.height
+ height: parent.height
+ }
+
+ OpacityRampEffect {
+ id: verticalBackgroundEffect
+ slope: 0.5
+ offset: -1.0
+ direction: OpacityRamp.TopToBottom
+ sourceItem: verticalback
+ }
+
+ OpacityRampEffect {
+ id: horizontalBackgroundEffect
+ slope: 1.2
+ offset: -0.7
+ direction: OpacityRamp.LeftToRight
+ sourceItem: horizontalback
+ }
+
+ OpacityRampEffect {
+ id: imageeffect
+ slope: 1.0
+ offset: 0.0
+ direction: OpacityRamp.TopToBottom
+ sourceItem: image
+ }
+}
height: implicitHeight + Theme.paddingLarge
PageHeader {
+ id: headerItem
title: qsTr("Journey list")
}
import QtQuick 2.0
import Sailfish.Silica 1.0
+import "../components"
Page {
id: page
}
// 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: "image://theme/icon-launcher-component-gallery"
+ 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()})
}
}
- SectionHeader {
- text: qsTr("Add a journey")
- }
-
- Button {
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Enter journey")
+ BarButton {
+ source: "image://theme/icon-launcher-component-gallery"
+ text: "Add a journey"
onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml"))
}
+ }
- SectionHeader {
- text: qsTr("Latest stats")
- }
+ Column {
+ id: column2
- Button {
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("View stats")
- onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml"))
- }
+ 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
- SectionHeader {
- text: qsTr("Previous journeys")
+ BarButton {
+ source: "image://theme/icon-launcher-component-gallery"
+ text: "View latest stats"
+ onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml"))
}
- Button {
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("View journeys")
+ BarButton {
+ source: "image://theme/icon-launcher-component-gallery"
+ text: "Previous journeys"
onClicked: pageStack.push(Qt.resolvedUrl("JourneyList.qml"))
}
-
}
}
}
</context>
<context>
<name>MainPage</name>
- <message>
- <source>Pedalo</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Cycle!</source>
- <translation type="unfinished"></translation>
- </message>
<message>
<source>Start a journey</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Add a journey</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Enter journey</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Latest stats</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>View stats</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Previous journeys</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>View journeys</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Finish</source>
+ <source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>About</source>
+ <source>Finish your journey</source>
<translation type="unfinished"></translation>
</message>
</context>
</context>
<context>
<name>MainPage</name>
- <message>
- <source>Pedalo</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Cycle!</source>
- <translation type="unfinished"></translation>
- </message>
<message>
<source>Start a journey</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Add a journey</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Enter journey</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Latest stats</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>View stats</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Previous journeys</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>View journeys</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Finish</source>
+ <source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>About</source>
+ <source>Finish your journey</source>
<translation type="unfinished"></translation>
</message>
</context>