nicer(?) calendar collapse fade

or at least more correct idk
This commit is contained in:
end-4
2025-05-05 11:29:14 +02:00
parent 6e34831183
commit 4285dce730
2 changed files with 24 additions and 2 deletions
@@ -188,6 +188,18 @@ Singleton {
property list<real> bezierCurve: animationCurves.emphasized
property int velocity: 650
}
property QtObject elementMoveEnter: QtObject {
property int duration: 400
property int type: Easing.BezierSpline
property list<real> bezierCurve: animationCurves.emphasizedDecel
property int velocity: 650
}
property QtObject elementMoveExit: QtObject {
property int duration: 200
property int type: Easing.BezierSpline
property list<real> bezierCurve: animationCurves.emphasizedAccel
property int velocity: 650
}
property QtObject elementMoveFast: QtObject {
property int duration: 200
property int type: Easing.BezierSpline
@@ -36,8 +36,16 @@ Rectangle {
function setCollapsed(state) {
collapsed = state
if (collapsed) bottomWidgetGroupRow.opacity = 0
else collapsedBottomWidgetGroupRow.opacity = 0
if (collapsed) {
bottomWidgetGroupRowFade.easing.bezierCurve = Appearance.animation.elementMoveExit.bezierCurve
bottomWidgetGroupRowFade.easing.bezierCurve = Appearance.animation.elementMoveEnter.bezierCurve
bottomWidgetGroupRow.opacity = 0
}
else {
bottomWidgetGroupRowFade.easing.bezierCurve = Appearance.animation.elementMoveExit.bezierCurve
bottomWidgetGroupRowFade.easing.bezierCurve = Appearance.animation.elementMoveEnter.bezierCurve
collapsedBottomWidgetGroupRow.opacity = 0
}
collapseCleanFadeTimer.start()
}
@@ -69,6 +77,7 @@ Rectangle {
visible: opacity > 0
Behavior on opacity {
NumberAnimation {
id: collapsedBottomWidgetGroupRowFade
duration: Appearance.animation.elementMove.duration / 2
easing.type: Appearance.animation.elementMove.type
easing.bezierCurve: Appearance.animation.elementMove.bezierCurve
@@ -109,6 +118,7 @@ Rectangle {
visible: opacity > 0
Behavior on opacity {
NumberAnimation {
id: bottomWidgetGroupRowFade
duration: Appearance.animation.elementMove.duration / 2
easing.type: Appearance.animation.elementMove.type
easing.bezierCurve: Appearance.animation.elementMove.bezierCurve