Mobile/filtering: clean up whitespace from last commit

This one does nothing but whitespace - separating it into two commits makes the
previous one a lot easier to read.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-20 06:02:15 -04:00
parent 00a80c0e08
commit 6d77e66b69

View file

@ -383,67 +383,67 @@ Kirigami.ScrollablePage {
anchors.right: parent.right anchors.right: parent.right
color: subsurfaceTheme.backgroundColor color: subsurfaceTheme.backgroundColor
enabled: rootItem.filterToggle enabled: rootItem.filterToggle
RowLayout { RowLayout {
id: filterBar id: filterBar
z: 5 //make sure it sits on top z: 5 //make sure it sits on top
states: [ states: [
State { State {
name: "isVisible" name: "isVisible"
when: rootItem.filterToggle when: rootItem.filterToggle
PropertyChanges { target: filterBar; height: sitefilter.implicitHeight } PropertyChanges { target: filterBar; height: sitefilter.implicitHeight }
}, },
State { State {
name: "isHidden" name: "isHidden"
when: !rootItem.filterToggle when: !rootItem.filterToggle
PropertyChanges { target: filterBar; height: 0 } PropertyChanges { target: filterBar; height: 0 }
} }
] ]
transitions: [ transitions: [
Transition { Transition {
NumberAnimation { property: "height"; duration: 400; easing.type: Easing.InOutQuad } NumberAnimation { property: "height"; duration: 400; easing.type: Easing.InOutQuad }
} }
] ]
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: Kirigami.Units.gridUnit / 2 anchors.leftMargin: Kirigami.Units.gridUnit / 2
anchors.rightMargin: Kirigami.Units.gridUnit / 2 anchors.rightMargin: Kirigami.Units.gridUnit / 2
onVisibleChanged: numShown.text = diveModel.shown() onVisibleChanged: numShown.text = diveModel.shown()
Controls.TextField { Controls.TextField {
id: sitefilter id: sitefilter
z: 10 z: 10
verticalAlignment: TextInput.AlignVCenter verticalAlignment: TextInput.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: true
text: "" text: ""
placeholderText: "Full text search" placeholderText: "Full text search"
onAccepted: { onAccepted: {
showBusy = true showBusy = true
console.log("show busy") console.log("show busy")
rootItem.filterPattern = text rootItem.filterPattern = text
diveModel.setFilter(text) diveModel.setFilter(text)
console.log("back from setFilter") console.log("back from setFilter")
showBusy = false showBusy = false
numShown.text = diveModel.shown() numShown.text = diveModel.shown()
} }
onEnabledChanged: { onEnabledChanged: {
// reset the filter when it gets toggled // reset the filter when it gets toggled
text = "" text = ""
if (visible) { if (visible) {
forceActiveFocus() forceActiveFocus()
}
} }
} }
Controls.Label {
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: ""
}
} }
Controls.Label {
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: ""
}
}
} }
} }