Display overall statistics
[harbour-pedalo.git] / qml / pages / JourneyList.qml
index 1708d20..2b722be 100644 (file)
@@ -6,15 +6,56 @@ Page {
 
     // The effective value will be restricted by ApplicationWindow.allowedOrientations
     allowedOrientations: Orientation.All
-    property int columnwidth: page.width - 2 * Theme.horizontalPageMargin
+    property int columnwidth: page.width - (2 * Theme.horizontalPageMargin) - 4 * Theme.paddingLarge
 
     SilicaListView {
         id: listView
         model: journeymodel
         anchors.fill: parent
-        header: PageHeader {
-            title: qsTr("Journey list")
+        header: Column {
+            width: page.width
+            spacing: Theme.paddingLarge
+            height: implicitHeight + Theme.paddingLarge
+
+            PageHeader {
+                title: qsTr("Journey list")
+            }
+
+            Row {
+                spacing: Theme.paddingLarge
+                x: Theme.horizontalPageMargin
+                y: headerItem.height
+
+                Label {
+                    width: columnwidth * 0.34
+                    text: "Date"
+                    color: Theme.secondaryColor
+                }
+                Label {
+                    width: columnwidth * 0.18
+                    text: "Start"
+                    color: Theme.secondaryColor
+                }
+                Label {
+                    width: columnwidth * 0.18
+                    text: "Length"
+                    color: Theme.secondaryColor
+                }
+                Label {
+                    width: columnwidth * 0.15
+                    text: "+"
+                    color: Theme.secondaryColor
+                    horizontalAlignment: Text.AlignRight
+                }
+                Label {
+                    width: columnwidth * 0.15
+                    text: "-"
+                    color: Theme.secondaryColor
+                    horizontalAlignment: Text.AlignRight
+                }
+            }
         }
+
         delegate: ListItem {
             id: delegate
             menu: journeyMenuComponent
@@ -24,20 +65,32 @@ Page {
                 x: Theme.horizontalPageMargin
 
                 Label {
-                    width: columnwidth / 3.0
+                    width: columnwidth * 0.34
                     text: Qt.formatDate(journeymodel.epochToDate(start), "d MMM yyyy")
                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                 }
                 Label {
-                    width: columnwidth / 3.0
+                    width: columnwidth * 0.18
                     text: Qt.formatTime(journeymodel.epochToTime(start), "hh:mm")
                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                 }
                 Label {
-                    width: columnwidth / 3.0
+                    width: columnwidth * 0.18
                     text: Qt.formatTime(new Date(0, 0, 0, 0, 0, duration), 'hh:mm')
                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                 }
+                Label {
+                    width: columnwidth * 0.15
+                    text: overtook
+                    color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+                    horizontalAlignment: Text.AlignRight
+                }
+                Label {
+                    width: columnwidth * 0.15
+                    text: overtakenby
+                    color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+                    horizontalAlignment: Text.AlignRight
+                }
             }
             onClicked: pageStack.push(Qt.resolvedUrl("JourneyInfo.qml"), {title: "Journey info", index: index, start: journeymodel.epochToDateTime(start), duration: duration, overtook: overtook, overtakenby: overtakenby})