Relayout StationListView Pulldown menu
[quandoparte] / application / resources / sailfish / qml / pages / StationListPage.qml
index e1c5b8c..a75c314 100644 (file)
@@ -18,20 +18,23 @@ Page {
         pressDelay: 0
         PullDownMenu {
             MenuItem {
-                text: qsTr("About Quando Parte")
-                onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
+                text: qsTr("Settings")
+                onClicked: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
             }
             MenuItem {
-                text: qsTr("Stations by Name")
-                onClicked: stationListProxyModel.sortingMode = StationListProxyModel.AlphaSorting
+                text: qsTr("Show Stations by Distance")
+                onClicked: stationListProxyModel.sortingMode = StationListProxyModel.DistanceSorting
+                enabled: (stationListProxyModel.sortingMode !== StationListProxyModel.DistanceSorting)
             }
             MenuItem {
-                text: qsTr("Stations by Distance")
-                onClicked: stationListProxyModel.sortingMode = StationListProxyModel.DistanceSorting
+                text: qsTr("Show Stations by Name")
+                onClicked: stationListProxyModel.sortingMode = StationListProxyModel.AlphaSorting
+                enabled: (stationListProxyModel.sortingMode !== StationListProxyModel.AlphaSorting)
             }
             MenuItem {
-                text: qsTr("Stations Recently Seen")
+                text: qsTr("Show Recent Stations")
                 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.RecentUsageSorting
+                enabled: (stationListProxyModel.sortingMode !== StationListProxyModel.RecentUsageSorting)
             }
         }
         PageHeader {
@@ -43,6 +46,7 @@ Page {
                 onTextChanged: stationListPage.searchPattern = searchField.text
                 width: stationListPage.width
                 EnterKey.onClicked: searchField.focus = false
+                EnterKey.iconSource: "image://theme/icon-m-enter-close"
             }
         }
         SilicaListView {
@@ -77,10 +81,6 @@ Page {
                         right: parent.right
                     }
                 }
-                onClicked: {
-                    searchField.focus = false
-                    Private.loadStation(model.name, model.code)
-                }
                 menu: contextMenu
                 Component {
                     id: contextMenu
@@ -98,6 +98,8 @@ Page {
                         }
                     }
                 }
+                onPressed: searchField.focus = false
+                onClicked: Private.loadStation(model.name, model.code)
             }
             VerticalScrollDecorator {}
         }