summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-20 11:57:36 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-23 22:45:30 +0100
commit2183e41bb040ab871f0c0b5cb079174b389b171c (patch)
tree3be018c651109a6d90c324a51dcf40c331c3d9aa /mobile-widgets
parent09507416c8a09511966d4be9abe08db5b3930070 (diff)
downloadsubsurface-2183e41bb040ab871f0c0b5cb079174b389b171c.tar.gz
Mobile/filtering: add properties for dive list model and filter text
This allows us to modify those from different parts of the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/DiveList.qml11
1 files changed, 4 insertions, 7 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index 8fee0e9fe..d5d85e3a6 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -20,6 +20,8 @@ Kirigami.ScrollablePage {
property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1
property string activeTrip
property bool showBusy: false
+ property QtObject diveListModel: diveModel
+ property string numShownText
supportsRefreshing: true
onRefreshingChanged: {
@@ -409,7 +411,6 @@ Kirigami.ScrollablePage {
anchors.right: parent.right
anchors.leftMargin: Kirigami.Units.gridUnit / 2
anchors.rightMargin: Kirigami.Units.gridUnit / 2
- onVisibleChanged: numShown.text = diveModel.shown()
Controls.TextField {
id: sitefilter
z: 10
@@ -424,7 +425,6 @@ Kirigami.ScrollablePage {
diveModel.setFilter(text)
console.log("back from setFilter")
showBusy = false
- numShown.text = diveModel.shown()
}
onEnabledChanged: {
// reset the filter when it gets toggled
@@ -438,10 +438,7 @@ Kirigami.ScrollablePage {
id: numShown
z: 10
verticalAlignment: Text.AlignVCenter
- // when this is first rendered, the model is still empty, so
- // instead of having a misleading 0 here, just don't show a count
- // it gets set whenever visibility or the search text changes
- text: ""
+ text: numShownText
}
}
}
@@ -452,7 +449,7 @@ Kirigami.ScrollablePage {
anchors.fill: parent
opacity: 1.0 - startPage.opacity
visible: opacity > 0
- model: diveModel
+ model: page.diveListModel
currentIndex: -1
delegate: diveDelegate
header: filterHeader