diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-10-20 05:58:31 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-23 22:45:30 +0100 |
commit | 76e4826fbc1126fd14cb62ddb519bc6bb193a8bd (patch) | |
tree | 78aef94fba1dd814a453a479cc49288574ee4478 /mobile-widgets | |
parent | e4e0c608e1234df4b238bfaf2a21abb7303cdca9 (diff) | |
download | subsurface-76e4826fbc1126fd14cb62ddb519bc6bb193a8bd.tar.gz |
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>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 2e0ef290e..5678ab103 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -375,36 +375,24 @@ Kirigami.ScrollablePage { id: filterHeader RowLayout { id: filterBar + enabled: rootItem.filterToggle z: 5 //make sure it sits on top states: [ State { name: "isVisible" when: rootItem.filterToggle - PropertyChanges { target: filterBar; visible: true; height: sitefilter.implicitHeight } + PropertyChanges { target: filterBar; height: sitefilter.implicitHeight } }, State { name: "isHidden" when: !rootItem.filterToggle - PropertyChanges { target: filterBar; visible: false; height: 0 } + PropertyChanges { target: filterBar; height: 0 } } ] transitions: [ Transition { - from: "isHidden" - 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 } - } + NumberAnimation { property: "height"; duration: 400; easing.type: Easing.InOutQuad } } ] @@ -428,7 +416,7 @@ Kirigami.ScrollablePage { showBusy = false numShown.text = diveModel.shown() } - onVisibleChanged: { + onEnabledChanged: { // reset the filter when it gets toggled text = "" if (visible) { |