Various UI fixes
authorThomas Perl <m@thp.io>
Wed, 14 Mar 2012 17:06:35 +0000 (18:06 +0100)
committerThomas Perl <m@thp.io>
Wed, 14 Mar 2012 17:06:35 +0000 (18:06 +0100)
qml/LinePad.qml
qml/LineSheet.qml
qml/MainPage.qml
qml/ubahnicon.png [new file with mode: 0644]

index ad65bac..bead39c 100644 (file)
@@ -6,6 +6,8 @@ Rectangle {
     id: linePad
     property alias currentLine: inputLine.text
 
+    signal accept
+
     /* List of available lines - will be filled w/ real data by LineSheet */
     property variant availableLines: ['59A', '63A', '58']
 
@@ -15,6 +17,7 @@ Rectangle {
         if (matches !== undefined) {
             if (matches.length == 1) {
                 inputLine.text = matches[0];
+                accept();
             }
         }
     }
@@ -126,9 +129,7 @@ Rectangle {
             Behavior on opacity { PropertyAnimation { } }
 
             color: {
-                if (ch == 'U') {
-                    return '#156ab8';
-                } else if (inputState.isMetro) {
+                if (inputState.isMetro) {
                     switch (ch) {
                         case 1: return '#E20A16';
                         case 2: return '#764785';
@@ -144,7 +145,18 @@ Rectangle {
             x: width*(index%3)
             y: inputLine.height + height*parseInt(index/3)
 
+            Image {
+                source: 'ubahnicon.png'
+                anchors {
+                    horizontalCenter: parent.horizontalCenter
+                    bottom: parent.bottom
+                }
+                visible: (inputElement.ch === 'U')
+            }
+
             Text {
+                id: text
+                visible: (inputElement.ch !== 'U')
                 anchors.centerIn: parent
                 text: modelData
                 font {
index 391eb33..36b74cb 100644 (file)
@@ -13,6 +13,7 @@ Sheet {
         id: linePad
         anchors.fill: parent
         availableLines: itip.get_lines()
+        onAccept: lineSheet.accept()
     }
 }
 
index 16090f0..c6deee0 100644 (file)
@@ -7,6 +7,7 @@ import "ExtrasConstants.js" as ExtrasConstants
 
 Page {
     tools: commonTools
+    orientationLock: PageOrientation.LockPortrait
 
     property bool canRefresh: realtimeResult.sourceUrl != '' || (realtimeResult.isStation && realtimeResult.gstation != '')
     //property alias stationSelect: stationSelector
diff --git a/qml/ubahnicon.png b/qml/ubahnicon.png
new file mode 100644 (file)
index 0000000..a46db0d
Binary files /dev/null and b/qml/ubahnicon.png differ