diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-10-17 16:50:19 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-23 22:45:29 +0100 |
commit | e5ee895793fcbece5941ba57b331343cc7b122b4 (patch) | |
tree | 94f0e302dbb93bf736e9f3ed9126d24b15862e1e /mobile-widgets/qml | |
parent | 2fe1750bf8cc943d9c8a1a192e47376886859752 (diff) | |
download | subsurface-e5ee895793fcbece5941ba57b331343cc7b122b4.tar.gz |
Mobile/filtering: animate the filter header
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 8dd8dd010..d8adbf73e 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -363,14 +363,58 @@ Kirigami.ScrollablePage { text: qsTr("No dives in dive list") visible: diveListView.visible && diveListView.count === 0 } - Component { id: filterHeader RowLayout { + id: filterBar + states: [ + State { + name: "isVisible" + when: rootItem.filterToggle + PropertyChanges { target: filterBar; visible: true; height: sitefilter.implicitHeight } + }, + State { + name: "isHidden" + when: !rootItem.filterToggle + PropertyChanges { target: filterBar; visible: false; 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 + } + } + } + ] + anchors.left: parent.left anchors.right: parent.right - visible: rootItem.filterToggle - height: rootItem.filterToggle ? sitefilter.implicitHeight * 1.1 : 0 Rectangle { width: Kirigami.Units.gridUnit / 4 } @@ -397,7 +441,6 @@ Kirigami.ScrollablePage { Rectangle { width: Kirigami.Units.regularSpacing } - } } |