feat: use behavior for launcher anim
No need for initial load
This commit is contained in:
parent
8a5905c9df
commit
d7d53260a7
1 changed files with 10 additions and 56 deletions
|
|
@ -29,63 +29,18 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property real nonAnimHeight: state === "visible" ? ((content.item as Content)?.nonAnimHeight ?? 0) : 0
|
readonly property real nonAnimHeight: state === "visible" ? ((content.item as Content)?.nonAnimHeight ?? 0) : 0
|
||||||
|
readonly property bool shouldBeActive: visibilities.dashboard && Config.dashboard.enabled
|
||||||
|
property real offsetScale: shouldBeActive ? 0 : 1
|
||||||
|
|
||||||
visible: anchors.topMargin > -implicitHeight - 5
|
visible: offsetScale < 1
|
||||||
anchors.topMargin: -implicitHeight - 5
|
anchors.topMargin: (-implicitHeight - 5) * offsetScale
|
||||||
implicitHeight: content.implicitHeight
|
implicitHeight: content.implicitHeight
|
||||||
implicitWidth: content.implicitWidth
|
implicitWidth: content.implicitWidth || 854 // Hard coded fallback for first open
|
||||||
|
|
||||||
onStateChanged: {
|
Behavior on offsetScale {
|
||||||
if (state === "visible" && timer.running) {
|
Anim {
|
||||||
timer.triggered();
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
timer.stop();
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: State {
|
|
||||||
name: "visible"
|
|
||||||
when: root.visibilities.dashboard && Config.dashboard.enabled
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
// root.implicitHeight: content.implicitHeight
|
|
||||||
root.anchors.topMargin: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
// from: ""
|
|
||||||
// to: "visible"
|
|
||||||
|
|
||||||
Anim {
|
|
||||||
target: root.anchors
|
|
||||||
property: "topMargin"
|
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Transition {
|
|
||||||
// from: "visible"
|
|
||||||
// to: ""
|
|
||||||
|
|
||||||
// Anim {
|
|
||||||
// target: root.anchors
|
|
||||||
// property: "topMargin"
|
|
||||||
// easing.bezierCurve: Appearance.anim.curves.emphasized
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: timer
|
|
||||||
|
|
||||||
running: true
|
|
||||||
interval: Appearance.anim.durations.extraLarge
|
|
||||||
onTriggered: {
|
|
||||||
content.active = Qt.binding(() => (root.visibilities.dashboard && Config.dashboard.enabled) || root.visible);
|
|
||||||
content.visible = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,8 +50,7 @@ Item {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
visible: false
|
active: root.shouldBeActive || root.visible
|
||||||
active: true
|
|
||||||
|
|
||||||
sourceComponent: Content {
|
sourceComponent: Content {
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue