Realtime search gui mockup
authorFlorian Schweikert <kelvan@logic.at>
Wed, 12 Oct 2011 17:28:18 +0000 (19:28 +0200)
committerFlorian Schweikert <kelvan@logic.at>
Wed, 12 Oct 2011 17:28:18 +0000 (19:28 +0200)
connect search and result page

gotovienna/gotovienna_qml/qml/gotovienna_qml/MainPage.qml
gotovienna/gotovienna_qml/qml/gotovienna_qml/ResultRealtime.qml [new file with mode: 0644]
gotovienna/gotovienna_qml/qml/gotovienna_qml/test.qml

index 29a77d2..5bd38e1 100644 (file)
@@ -7,10 +7,9 @@ Page {
     tools: commonTools
 
     TextField {
-        placeholderText: 'origin'
+        placeholderText: 'Line'
 
-        id: origin
-        text: "Test"
+        id: gline
         anchors {
             top: parent.top
             left: parent.left
@@ -19,11 +18,10 @@ Page {
             rightMargin: 10
         }
         width: parent.width - 20
-        //width: parent.width - anchors.leftMargin - anchors.rightMargin
 
          MouseArea {
              anchors.fill: parent
-             drag.target: origin
+             drag.target: gline
              drag.axis: Drag.YAxis
              drag.minimumY: 0
              drag.maximumY: parent.height
@@ -31,10 +29,10 @@ Page {
     }
 
     TextField {
-        placeholderText: 'destination'
-        id: destination
+        placeholderText: 'Station'
+        id: gstation
         anchors {
-            top: origin.bottom
+            top: gline.bottom
             left: parent.left
             right: parent.right
             topMargin: 10
@@ -43,18 +41,20 @@ Page {
         }
     }
 
+    ResultRealtime { id: resu }
+
     Button {
         id: btnSearch
         text: 'Search'
         anchors {
-            top: destination.bottom
+            top: gstation.bottom
             topMargin: 10
             horizontalCenter: parent.horizontalCenter
         }
         onClicked: {
-            console.debug("Origin: " + origin.text)
-            console.debug("Destination: " + destination.text)
-            pageStack.push(Qt.resolvedUrl("test.qml"))
+            resu.gline = gline.text
+            resu.gstation = gstation.text
+            pageStack.push(resu)
         }
     }
 }
diff --git a/gotovienna/gotovienna_qml/qml/gotovienna_qml/ResultRealtime.qml b/gotovienna/gotovienna_qml/qml/gotovienna_qml/ResultRealtime.qml
new file mode 100644 (file)
index 0000000..04c4ca1
--- /dev/null
@@ -0,0 +1,221 @@
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import com.nokia.extras 1.0
+import "UIConstants.js" as UIConstants
+import "ExtrasConstants.js" as ExtrasConstants
+
+Page {
+    tools: commonTools
+
+    property string gline : ""
+    property string gstation : ""
+
+    Component {
+         id: departureDelegate
+
+         Item {
+             width: parent.width
+             height: 80
+
+             BorderImage {
+                 anchors.fill: parent
+                 visible: mouseArea.pressed
+                 source: theme.inverted ? 'image://theme/meegotouch-list-inverted-background-pressed-vertical-center': 'image://theme/meegotouch-list-background-pressed-vertical-center'
+             }
+
+             Item {
+                 anchors.fill: parent
+                 anchors.margins: UIConstants.DEFAULT_MARGIN
+
+                 Row {
+                     Text {
+                         id: l
+                         text: line // <----
+                         anchors.verticalCenter: parent.verticalCenter
+                         width: 70
+                         font.pixelSize: UIConstants.FONT_XLARGE
+                         font.bold: true
+                         font.family: ExtrasConstants.FONT_FAMILY_LIGHT
+                         color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
+                     }
+
+                     Column {
+                         anchors.verticalCenter: parent.verticalCenter
+
+                         Text {
+                             id: s
+                             text: station // <----
+                             width: 75
+                             font.pixelSize: UIConstants.FONT_LARGE
+                             font.family: ExtrasConstants.FONT_FAMILY_LIGHT
+                             color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
+                         }
+
+                         Text {
+                             id: d
+                             text: destination // <----
+                             color: !theme.inverted ? UIConstants.COLOR_SECONDARY_FOREGROUND : UIConstants.COLOR_INVERTED_SECONDARY_FOREGROUND
+                             font.family: ExtrasConstants.FONT_FAMILY_LIGHT
+                             font.pixelSize: UIConstants.FONT_LSMALL
+                         }
+                     }
+                 }
+             }
+
+             Column {
+                 anchors.right: parent.right
+                 anchors.verticalCenter: parent.verticalCenter
+                 Text {
+                     id: dep
+                     // FIXME strange int float transformation appears
+                     text: departure
+                     anchors.right: parent.right
+                     anchors.rightMargin: UIConstants.DEFAULT_MARGIN
+                     font.bold: true
+                     font.pixelSize: UIConstants.FONT_XLARGE
+                     font.family: ExtrasConstants.FONT_FAMILY_LIGHT
+                     color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
+                 }
+             }
+
+             MouseArea {
+                 id: mouseArea
+                 anchors.fill: parent
+                 onClicked: {
+                     console.debug("clicked: " + l.text)
+                 }
+             }
+         }
+     }
+
+    Component {
+             id: heading
+             Rectangle {
+                 width: parent.width
+                 height: childrenRect.height + 2*UIConstants.DEFAULT_MARGIN
+                 color: "lightsteelblue"
+
+                 Text {
+                     anchors {
+                         top: parent.top
+                         left: parent.left
+                         margins: UIConstants.DEFAULT_MARGIN
+                     }
+
+                     text: gstation + " [" + gline + "]"
+                     font.bold: true
+                     font.family: ExtrasConstants.FONT_FAMILY_LIGHT
+                     font.pixelSize: UIConstants.FONT_LSMALL
+                 }
+             }
+         }
+
+     ListView {
+         id: list
+         width: parent.width; height: parent.height
+
+         header: heading
+
+         model: ListModel {
+            ListElement {
+                line: "N60"
+                station: "Schottentor"
+                destination: "Maurer Hauptplatz"
+                departure: 5
+            }
+            ListElement {
+                line: "N38"
+                station: "Schottentor"
+                destination: "Grinzing"
+                departure: 7
+            }
+            ListElement {
+                line: "N25"
+                station: "Schottentor"
+                destination: "Großfeldsiedlung"
+                departure: 8
+            }
+            ListElement {
+                line: "N41"
+                station: "Schottentor"
+                destination: "Pötzleinsdorf"
+                departure: 12
+            }
+            ListElement {
+                line: "N43"
+                station: "Schottentor"
+                destination: "Neuwaldegg"
+                departure: 12
+            }
+            ListElement {
+                line: "N66"
+                station: "Schottentor"
+                destination: "Liesing S"
+                departure: 20
+            }
+            ListElement {
+                line: "N38"
+                station: "Schottentor"
+                destination: "Grinzing"
+                departure: 22
+            }
+            ListElement {
+                line: "N25"
+                station: "Schottentor"
+                destination: "Großfeldsiedlung"
+                departure: 35
+            }
+            ListElement {
+                line: "N60"
+                station: "Schottentor"
+                destination: "Maurer Hauptplatz"
+                departure: 35
+            }
+            ListElement {
+                line: "N38"
+                station: "Schottentor"
+                destination: "Grinzing"
+                departure: 37
+            }
+            ListElement {
+                line: "N41"
+                station: "Schottentor"
+                destination: "Pötzleinsdorf"
+                departure: "03:12"
+            }
+            ListElement {
+                line: "N43"
+                station: "Schottentor"
+                destination: "Neuwaldegg"
+                departure: 42
+            }
+            ListElement {
+                line: "N66"
+                station: "Schottentor"
+                destination: "Liesing S"
+                departure: 50
+            }
+            ListElement {
+                line: "N38"
+                station: "Schottentor"
+                destination: "Grinzing"
+                departure: 52
+            }
+         }
+         delegate: departureDelegate
+     }
+
+     ScrollDecorator {
+         id: scrolldecorator
+         flickableItem: list
+         platformStyle: ScrollDecoratorStyle {}
+     }
+
+     /*BusyIndicator {
+         id: busyIndicator
+         visible: true
+         running: true
+         platformStyle: BusyIndicatorStyle { size: 'large' }
+         anchors.centerIn: parent
+     }*/
+}
index ad57c91..f2fbe6e 100644 (file)
@@ -184,11 +184,11 @@ Page {
          platformStyle: ScrollDecoratorStyle {}
      }
 
-     /*BusyIndicator {
+     BusyIndicator {
          id: busyIndicator
          visible: true
          running: true
          platformStyle: BusyIndicatorStyle { size: 'large' }
          anchors.centerIn: parent
-     }*/
+     }
 }