2 import Sailfish.Silica 1.0
7 // The effective value will be restricted by ApplicationWindow.allowedOrientations
8 allowedOrientations: Orientation.All
9 property int columnwidth: page.width - (2 * Theme.horizontalPageMargin) - 4 * Theme.paddingLarge
17 spacing: Theme.paddingLarge
18 height: implicitHeight + Theme.paddingLarge
21 title: qsTr("Journey list")
25 spacing: Theme.paddingLarge
26 x: Theme.horizontalPageMargin
30 width: columnwidth * 0.34
32 color: Theme.secondaryColor
35 width: columnwidth * 0.18
37 color: Theme.secondaryColor
40 width: columnwidth * 0.18
42 color: Theme.secondaryColor
45 width: columnwidth * 0.15
47 color: Theme.secondaryColor
48 horizontalAlignment: Text.AlignRight
51 width: columnwidth * 0.15
53 color: Theme.secondaryColor
54 horizontalAlignment: Text.AlignRight
61 menu: journeyMenuComponent
64 spacing: Theme.paddingLarge
65 x: Theme.horizontalPageMargin
68 width: columnwidth * 0.34
69 text: Qt.formatDate(journeymodel.epochToDate(start), "d MMM yyyy")
70 color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
73 width: columnwidth * 0.18
74 text: Qt.formatTime(journeymodel.epochToTime(start), "hh:mm")
75 color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
78 width: columnwidth * 0.18
79 text: Qt.formatTime(new Date(0, 0, 0, 0, 0, duration), 'hh:mm')
80 color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
83 width: columnwidth * 0.15
85 color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
86 horizontalAlignment: Text.AlignRight
89 width: columnwidth * 0.15
91 color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
92 horizontalAlignment: Text.AlignRight
95 onClicked: pageStack.push(Qt.resolvedUrl("JourneyInfo.qml"), {title: "Journey info", index: index, start: journeymodel.epochToDateTime(start), duration: duration, overtook: overtook, overtakenby: overtakenby})
98 id: journeyMenuComponent
102 onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml"), {title: "Edit journey", index: index, start: journeymodel.epochToDateTime(start), duration: duration, overtook: overtook, overtakenby: overtakenby})
106 onClicked: remove(index)
111 function remove(index) {
112 remorseAction(qsTr("Deleting journey"), function() {
113 onClicked: journeymodel.deleteJourney(index)
117 VerticalScrollDecorator {}