From 2183e41bb040ab871f0c0b5cb079174b389b171c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 20 Oct 2018 11:57:36 -0400 Subject: 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 --- mobile-widgets/qml/DiveList.qml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'mobile-widgets/qml') 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 -- cgit v1.2.3-70-g09d2