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 {
SearchField {
id: searchField
placeholderText: qsTr("Search station...")
- inputMethodHints: Qt.ImhNoAutoUppercase
+ inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
onTextChanged: stationListPage.searchPattern = searchField.text
width: stationListPage.width
EnterKey.onClicked: searchField.focus = false
+ EnterKey.iconSource: "image://theme/icon-m-enter-close"
}
}
SilicaListView {
anchors.top: header.bottom
anchors.bottom: parent.bottom
model: stationListProxyModel
- objectName:
- searchField.focus = false
delegate: ListItem {
id: listItem
contentHeight: Theme.itemSizeExtraSmall
right: parent.right
}
}
- onClicked: {
- Private.loadStation(model.name, model.code)
- }
- //onPressAndHold: contextMenu.show(listItem)
menu: contextMenu
Component {
id: contextMenu
MenuItem {
text: model.favorite ? qsTr("Remove from Favorites") : qsTr("Add to Favorites")
onClicked: {
- console.log("Favorite Stations (before):" + settings.favoriteStations)
model.favorite ^= true
- /*
- var index = settings.favoriteStations.indexOf(model.name)
- if (index === -1)
- settings.favoriteStations.push(model.name)
- else settings.favoriteStations.splice(index, 1)
- */
- console.log("Favorite Stations (after):" + settings.favoriteStations)
+ console.log("Favorite Stations:" + settings.favoriteStations)
}
}
MenuItem {
}
}
}
+ onPressed: searchField.focus = false
+ onClicked: Private.loadStation(model.name, model.code)
}
VerticalScrollDecorator {}
}