mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: animate trip folding
This looks much nicer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6a51c14365
commit
a454b4fd19
1 changed files with 55 additions and 2 deletions
|
@ -49,14 +49,67 @@ Kirigami.ScrollablePage {
|
||||||
supportsMouseEvents: true
|
supportsMouseEvents: true
|
||||||
checked: diveListView.currentIndex === model.index
|
checked: diveListView.currentIndex === model.index
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: dive.tripMeta === activeTrip ? diveListEntry.height + Kirigami.Units.smallSpacing : 0
|
height: 0
|
||||||
visible: dive.tripMeta === activeTrip
|
visible: false
|
||||||
backgroundColor: checked ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
backgroundColor: checked ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
||||||
activeBackgroundColor: subsurfaceTheme.primaryColor
|
activeBackgroundColor: subsurfaceTheme.primaryColor
|
||||||
textColor: checked ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.textColor
|
textColor: checked ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.textColor
|
||||||
|
|
||||||
property real detailsOpacity : 0
|
property real detailsOpacity : 0
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "isHidden";
|
||||||
|
when: dive.tripMeta !== activeTrip
|
||||||
|
PropertyChanges {
|
||||||
|
target: innerListItem
|
||||||
|
height: 0
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "isVisible";
|
||||||
|
when: dive.tripMeta === activeTrip
|
||||||
|
PropertyChanges {
|
||||||
|
target: innerListItem
|
||||||
|
height: diveListEntry.height + Kirigami.Units.smallSpacing
|
||||||
|
visible: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
from: "isHidden"
|
||||||
|
to: "isVisible"
|
||||||
|
SequentialAnimation {
|
||||||
|
NumberAnimation {
|
||||||
|
property: "visible"
|
||||||
|
duration: 1
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
property: "height"
|
||||||
|
duration: 200 + 20 * dive.tripNrDives
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Transition {
|
||||||
|
from: "isVisible"
|
||||||
|
to: "isHidden"
|
||||||
|
SequentialAnimation {
|
||||||
|
NumberAnimation {
|
||||||
|
property: "height"
|
||||||
|
duration: 200 + 20 * dive.tripNrDives
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
property: "visible"
|
||||||
|
duration: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
// When clicked, the mode changes to details view
|
// When clicked, the mode changes to details view
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (detailsWindow.state === "view") {
|
if (detailsWindow.state === "view") {
|
||||||
|
|
Loading…
Add table
Reference in a new issue