mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile/filtering: animate the filter header
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2fe1750bf8
commit
e5ee895793
1 changed files with 47 additions and 4 deletions
|
@ -363,14 +363,58 @@ Kirigami.ScrollablePage {
|
||||||
text: qsTr("No dives in dive list")
|
text: qsTr("No dives in dive list")
|
||||||
visible: diveListView.visible && diveListView.count === 0
|
visible: diveListView.visible && diveListView.count === 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: filterHeader
|
id: filterHeader
|
||||||
RowLayout {
|
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.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
visible: rootItem.filterToggle
|
|
||||||
height: rootItem.filterToggle ? sitefilter.implicitHeight * 1.1 : 0
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: Kirigami.Units.gridUnit / 4
|
width: Kirigami.Units.gridUnit / 4
|
||||||
}
|
}
|
||||||
|
@ -397,7 +441,6 @@ Kirigami.ScrollablePage {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: Kirigami.Units.regularSpacing
|
width: Kirigami.Units.regularSpacing
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue