From 4285dce7304932533d62306dbe8fb4f7eb4b7ae2 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 5 May 2025 11:29:14 +0200 Subject: [PATCH] nicer(?) calendar collapse fade or at least more correct idk --- .config/quickshell/modules/common/Appearance.qml | 12 ++++++++++++ .../modules/sidebarRight/BottomWidgetGroup.qml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/modules/common/Appearance.qml b/.config/quickshell/modules/common/Appearance.qml index c1029c3ee..7a247bc9c 100644 --- a/.config/quickshell/modules/common/Appearance.qml +++ b/.config/quickshell/modules/common/Appearance.qml @@ -188,6 +188,18 @@ Singleton { property list bezierCurve: animationCurves.emphasized property int velocity: 650 } + property QtObject elementMoveEnter: QtObject { + property int duration: 400 + property int type: Easing.BezierSpline + property list bezierCurve: animationCurves.emphasizedDecel + property int velocity: 650 + } + property QtObject elementMoveExit: QtObject { + property int duration: 200 + property int type: Easing.BezierSpline + property list bezierCurve: animationCurves.emphasizedAccel + property int velocity: 650 + } property QtObject elementMoveFast: QtObject { property int duration: 200 property int type: Easing.BezierSpline diff --git a/.config/quickshell/modules/sidebarRight/BottomWidgetGroup.qml b/.config/quickshell/modules/sidebarRight/BottomWidgetGroup.qml index 1e551c4e3..d8b1a9208 100644 --- a/.config/quickshell/modules/sidebarRight/BottomWidgetGroup.qml +++ b/.config/quickshell/modules/sidebarRight/BottomWidgetGroup.qml @@ -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