Use new showArrivalsPreferred setting in StationPage
authorLuciano Montanaro <mikelima@cirulla.net>
Sat, 30 Jul 2011 23:19:03 +0000 (01:19 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:16:48 +0000 (23:16 +0100)
application/resources/harmattan/qml/StationPage.qml

index bf1b7e1..2abf241 100644 (file)
@@ -1,6 +1,7 @@
 import QtQuick 1.1
 import QtWebKit 1.0
 import com.nokia.meego 1.0
+import net.cirulla.quandoparte 1.0
 
 Page {
     property alias html: view.html
@@ -11,12 +12,37 @@ Page {
         ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
         ToolIcon { iconId: "icon-m-toolbar-view-menu"; }
     }
+    PageHeader {
+        id: header
+        anchors.top: parent.top
+        selectedIndex: settings.showArrivalsPreferred ? 1 : 0
+        options: ListModel {
+            id: dialogOptions
+            ListElement {
+                name: QT_TR_NOOP("Departures")
+            }
+            ListElement {
+                name: QT_TR_NOOP("Arrivals")
+            }
+        }
+    }
+    Binding {
+        target: settings
+        property: "showArrivalsPreferred"
+        value: header.selectedIndex === 1 ? true : false
+    }
     LabelStyle {
         id: labelStyle
     }
     WebView {
         id: view
-        anchors.fill: parent
+        anchors {
+            top: header.bottom;
+            bottom: parent.bottom;
+        }
+        width: parent.width
+
+
         settings.defaultFontSize: labelStyle.fontPixelSize
         settings.defaultFixedFontSize: labelStyle.fontPixelSize
         settings.standardFontFamily: labelStyle.fontFamily