**bounciness**
This commit is contained in:
@@ -21,53 +21,27 @@ Item {
|
||||
}
|
||||
required property var panels
|
||||
required property ShellScreen screen
|
||||
readonly property bool shouldBeActive: visibilities.launcher
|
||||
required property PersistentProperties visibilities
|
||||
readonly property bool shouldBeActive: visibilities.launcher
|
||||
property real offsetScale: shouldBeActive ? 0 : 1
|
||||
|
||||
implicitHeight: 0
|
||||
implicitWidth: content.implicitWidth
|
||||
visible: height > 0
|
||||
visible: offsetScale < 1
|
||||
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
|
||||
implicitHeight: contentHeight
|
||||
implicitWidth: content.implicitWidth || 400
|
||||
opacity: 1 - offsetScale
|
||||
|
||||
Behavior on offsetScale {
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
onMaxHeightChanged: timer.start()
|
||||
onShouldBeActiveChanged: {
|
||||
if (shouldBeActive) {
|
||||
timer.stop();
|
||||
hideAnim.stop();
|
||||
showAnim.start();
|
||||
} else {
|
||||
showAnim.stop();
|
||||
hideAnim.start();
|
||||
}
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
id: showAnim
|
||||
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.small
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
|
||||
property: "implicitHeight"
|
||||
target: root
|
||||
to: root.contentHeight
|
||||
}
|
||||
|
||||
ScriptAction {
|
||||
script: root.implicitHeight = Qt.binding(() => content.implicitHeight)
|
||||
}
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
id: hideAnim
|
||||
|
||||
ScriptAction {
|
||||
script: root.implicitHeight = root.implicitHeight
|
||||
}
|
||||
|
||||
Anim {
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
|
||||
property: "implicitHeight"
|
||||
target: root
|
||||
to: 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,10 +79,6 @@ Item {
|
||||
root.contentHeight = Math.min(root.maxHeight, content.implicitHeight);
|
||||
content.active = Qt.binding(() => root.shouldBeActive || root.visible);
|
||||
content.visible = true;
|
||||
if (showAnim.running) {
|
||||
showAnim.stop();
|
||||
showAnim.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +89,6 @@ Item {
|
||||
active: false
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
visible: false
|
||||
|
||||
sourceComponent: Content {
|
||||
maxHeight: root.maxHeight
|
||||
|
||||
Reference in New Issue
Block a user