2 import Sailfish.Silica 1.0
3 import net.cirulla.quandoparte 1.0
4 import "StationListPage.js" as Private
8 property variant stationView
9 property string searchPattern
11 target: stationListProxyModel
12 property: "searchPattern"
13 value: stationListPage.searchPattern
20 anchors.top: parent.top
21 anchors.bottom: parent.bottom
22 model: stationListProxyModel
25 text: qsTr("About Quando Parte")
26 onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
29 text: qsTr("Stations by Name")
30 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.AlphaSorting
33 text: qsTr("Stations by Distance")
34 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.DistanceSorting
37 text: qsTr("Stations Recently Seen")
38 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.RecentUsageSorting
43 placeholderText: qsTr("Search station...")
44 inputMethodHints: Qt.ImhNoAutoUppercase
45 onTextChanged: stationListPage.searchPattern = searchField.text
46 width: stationListPage.width
48 delegate: BackgroundItem {
50 height: Theme.itemSizeExtraSmall
56 margins: Theme.paddingMedium
59 textFormat: Text.StyledText
60 text: model.name ? Private.highlightSearch(model.name, Theme.highlightColor) : ""
61 verticalAlignment: Text.AlignVCenter
65 visible: model.favorite
66 source: "image://theme/icon-m-favorite-selected"
68 verticalCenter: parent.verticalCenter
72 onClicked: Private.loadStation(model.name, model.code)
73 onPressAndHold: contextMenu.show(listItem)
77 text: qsTr("Show on the map")
78 onClicked: Qt.openUrlExternally("geo:" + model.longitude + "," + model.latitude)