Added busy indicator
authorLuciano Montanaro <mikelima@cirulla.net>
Sat, 26 Nov 2011 18:02:39 +0000 (19:02 +0100)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:19:12 +0000 (23:19 +0100)
application/resources/harmattan/qml/StationPage.qml

index 2e97987..d86e4da 100644 (file)
@@ -62,12 +62,13 @@ Page {
         ListView {
             id: stationScheduleView
             clip: true
+            visible: false
             width: parent.width
             height: parent.height
             model:  schedule
             delegate: Item {
                 id: listItem
-                height: 192
+                height: 64
                 width: parent.width
                 BorderImage {
                     id: background
@@ -84,7 +85,7 @@ Page {
 
                         Label {
                             id: mainText
-                            text: model.display
+                            text: train
                             font.bold: true
                         }
                     }
@@ -103,10 +104,33 @@ Page {
                 }
             }
         }
+        BusyIndicator {
+            id: busyIndicator
+            anchors.centerIn: view
+            visible: !stationScheduleView.visible
+            running: visible
+        }
+        states: [
+            State {
+                name: "loading"
+                PropertyChanges {
+                    target: stationScheduleView
+                    visible: false
+                }
+            },
+            State {
+                name: "ready"
+                PropertyChanges {
+                    target: stationScheduleView
+                    visible: true
+                }
+            }
+        ]
     }
-
     StationScheduleModel {
         id: schedule
         onNameChanged: schedule.fetch(name)
+        onLayoutChanged: view.state = "ready"
     }
+
  }