Added delay class indicator
authorLuciano Montanaro <mikelima@cirulla.net>
Sun, 18 Dec 2011 00:06:06 +0000 (01:06 +0100)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:19:14 +0000 (23:19 +0100)
Now the delay class is shown as a bar on the left of the schedule item.

application/application.pro
application/resources/harmattan/qml/DelayIndicator.qml [new file with mode: 0644]
application/resources/harmattan/qml/StationPage.qml

index ee1e5f9..a0c7beb 100644 (file)
@@ -124,7 +124,8 @@ OTHER_FILES += \
     resources/harmattan/qml/StationListPage.js \
     resources/harmattan/qml/AboutPage.qml \
     resources/harmattan/qml/InfoBar.qml \
-    resources/harmattan/qml/DroppedShadow.qml
+    resources/harmattan/qml/DroppedShadow.qml \
+    resources/harmattan/qml/DelayIndicator.qml
 
 unix {
     isEmpty(PREFIX) {
@@ -198,3 +199,4 @@ harmattan {
     INSTALLS += qml
 }
 
+
diff --git a/application/resources/harmattan/qml/DelayIndicator.qml b/application/resources/harmattan/qml/DelayIndicator.qml
new file mode 100644 (file)
index 0000000..6b8394d
--- /dev/null
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+import "uiconstants.js" as UiConstants
+
+Item {
+    id: indicator
+    property int level: 0
+    width: UiConstants.DefaultMargin
+    anchors{
+        top: parent.top
+        bottom: parent.bottom
+    }
+    Rectangle {
+        id: rect
+        width: 10
+        height: parent.height
+        anchors.left: parent.left
+        color: {
+            switch (indicator.level) {
+            case 0: return "#0b0"
+            case 1: return "#dd0"
+            case 2: return "#da0"
+            case 3: return "#d60"
+            case 4: return "#d00"
+            default: return "#b0b"
+            }
+        }
+    }
+}
index 48c33e7..174a761 100644 (file)
@@ -74,8 +74,10 @@ Page {
                 }
                 Row {
                     anchors.fill: parent
-
                     spacing: UiConstants.ButtonSpacing
+                    DelayIndicator {
+                        level: delayClass
+                    }
                     Column {
                         anchors.verticalCenter: parent.verticalCenter
                         Row {