Various improvements to LinePad + UI flow
authorThomas Perl <m@thp.io>
Wed, 11 Jan 2012 15:09:36 +0000 (16:09 +0100)
committerThomas Perl <m@thp.io>
Wed, 11 Jan 2012 15:09:36 +0000 (16:09 +0100)
qml/LinePad.qml
qml/MainPage.qml

index 1d6bd59..fbc1ccd 100644 (file)
@@ -1,5 +1,6 @@
 
 import QtQuick 1.0
 
 import QtQuick 1.0
+import QtMobility.feedback 1.1
 
 Rectangle {
     id: linePad
 
 Rectangle {
     id: linePad
@@ -34,6 +35,22 @@ Rectangle {
     height: 800
     width: 480
 
     height: 800
     width: 480
 
+     HapticsEffect {
+         id: buttonFeedback
+
+         /**
+          * Ideally we would use ThemeEffect here,
+          * but on Harmattan it has no effect (sic)
+          **/
+
+         attackIntensity: 0.5
+         attackTime: 100
+         intensity: 1.0
+         duration: 50
+         fadeTime: 0
+         fadeIntensity: 0.0
+     }
+
     Text {
         id: inputLine
         horizontalAlignment: Text.AlignHCenter
     Text {
         id: inputLine
         horizontalAlignment: Text.AlignHCenter
@@ -72,7 +89,10 @@ Rectangle {
                     fill: parent
                     margins: -(inputLine.height - height)/2
                 }
                     fill: parent
                     margins: -(inputLine.height - height)/2
                 }
-                onClicked: inputLine.text = ''
+                onClicked: {
+                    buttonFeedback.start()
+                    inputLine.text = ''
+                }
             }
         }
     }
             }
         }
     }
@@ -143,6 +163,7 @@ Rectangle {
             MouseArea {
                 anchors.fill: parent
                 onClicked: {
             MouseArea {
                 anchors.fill: parent
                 onClicked: {
+                    buttonFeedback.start()
                     inputLine.text += modelData
                 }
             }
                     inputLine.text += modelData
                 }
             }
index 9f1a7f7..a14e48d 100644 (file)
@@ -77,11 +77,6 @@ Page {
 
         onTextChanged: {
             gstation.text = ''
 
         onTextChanged: {
             gstation.text = ''
-
-            if (lineSelector.selectedIndex === -1) {
-                text = text.toUpperCase()
-                return
-            }
         }
 
          MouseArea {
         }
 
          MouseArea {
@@ -95,7 +90,12 @@ Page {
 
     LineSheet {
         id: lineSheet
 
     LineSheet {
         id: lineSheet
-        onAccepted: gline.text = currentLine
+        onAccepted: {
+            gline.text = currentLine
+
+            /* We usually want to select a station after selecting a line */
+            stationPickerButton.clicked()
+        }
     }
 
     Button {
     }
 
     Button {
@@ -111,7 +111,10 @@ Page {
         width: 60
         iconSource: 'image://theme/icon-m-common-search'
 
         width: 60
         iconSource: 'image://theme/icon-m-common-search'
 
-        onClicked: lineSheet.open()
+        onClicked: {
+            lineSheet.currentLine = ''
+            lineSheet.open()
+        }
     }
 
     TextField {
     }
 
     TextField {