From: Thomas Perl Date: Wed, 11 Jan 2012 15:09:36 +0000 (+0100) Subject: Various improvements to LinePad + UI flow X-Git-Url: http://git.maemo.org/git/?p=pywienerlinien;a=commitdiff_plain;h=e069deef85dd16cf7070b5f1d7272a867a2a7fb3 Various improvements to LinePad + UI flow --- diff --git a/qml/LinePad.qml b/qml/LinePad.qml index 1d6bd59..fbc1ccd 100644 --- a/qml/LinePad.qml +++ b/qml/LinePad.qml @@ -1,5 +1,6 @@ import QtQuick 1.0 +import QtMobility.feedback 1.1 Rectangle { id: linePad @@ -34,6 +35,22 @@ Rectangle { 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 @@ -72,7 +89,10 @@ Rectangle { 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: { + buttonFeedback.start() inputLine.text += modelData } } diff --git a/qml/MainPage.qml b/qml/MainPage.qml index 9f1a7f7..a14e48d 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -77,11 +77,6 @@ Page { onTextChanged: { gstation.text = '' - - if (lineSelector.selectedIndex === -1) { - text = text.toUpperCase() - return - } } MouseArea { @@ -95,7 +90,12 @@ Page { 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 { @@ -111,7 +111,10 @@ Page { width: 60 iconSource: 'image://theme/icon-m-common-search' - onClicked: lineSheet.open() + onClicked: { + lineSheet.currentLine = '' + lineSheet.open() + } } TextField {