mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:23:23 +00:00
Mobile/filtering: simplify transitions
We don't need to toggle visibility, toggling height is sufficient. This dramatically simplifies the transitions. But as a result we need to use the 'enabled' property to reset the filter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e4e0c608e1
commit
76e4826fbc
1 changed files with 5 additions and 17 deletions
|
@ -375,36 +375,24 @@ Kirigami.ScrollablePage {
|
||||||
id: filterHeader
|
id: filterHeader
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: filterBar
|
id: filterBar
|
||||||
|
enabled: rootItem.filterToggle
|
||||||
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; visible: true; height: sitefilter.implicitHeight }
|
PropertyChanges { target: filterBar; height: sitefilter.implicitHeight }
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "isHidden"
|
name: "isHidden"
|
||||||
when: !rootItem.filterToggle
|
when: !rootItem.filterToggle
|
||||||
PropertyChanges { target: filterBar; visible: false; height: 0 }
|
PropertyChanges { target: filterBar; height: 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
from: "isHidden"
|
NumberAnimation { property: "height"; duration: 400; easing.type: Easing.InOutQuad }
|
||||||
to: "isVisible"
|
|
||||||
SequentialAnimation {
|
|
||||||
NumberAnimation { property: "visible"; duration: 1 }
|
|
||||||
NumberAnimation { property: "height"; duration: 200; easing.type: Easing.InOutQuad }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Transition {
|
|
||||||
from: "isVisible"
|
|
||||||
to: "isHidden"
|
|
||||||
SequentialAnimation {
|
|
||||||
NumberAnimation { property: "height"; duration: 200; easing.type: Easing.InOutQuad }
|
|
||||||
NumberAnimation { property: "visible"; duration: 1 }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -428,7 +416,7 @@ Kirigami.ScrollablePage {
|
||||||
showBusy = false
|
showBusy = false
|
||||||
numShown.text = diveModel.shown()
|
numShown.text = diveModel.shown()
|
||||||
}
|
}
|
||||||
onVisibleChanged: {
|
onEnabledChanged: {
|
||||||
// reset the filter when it gets toggled
|
// reset the filter when it gets toggled
|
||||||
text = ""
|
text = ""
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue