From b3723f7dc67cac57314b8d7eecd12a9f4b8d0035 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 10 May 2025 08:53:03 +0200 Subject: [PATCH] notifications: adjust animations --- .../common/widgets/NotificationWidget.qml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/quickshell/modules/common/widgets/NotificationWidget.qml b/.config/quickshell/modules/common/widgets/NotificationWidget.qml index d66ea6b3f..338cd86f6 100644 --- a/.config/quickshell/modules/common/widgets/NotificationWidget.qml +++ b/.config/quickshell/modules/common/widgets/NotificationWidget.qml @@ -22,6 +22,8 @@ Item { property bool ready: false property int defaultTimeoutValue: 5000 + property var notificationXAnimation: Appearance.animation.elementMoveEnter + Layout.fillWidth: true clip: !popup @@ -45,6 +47,7 @@ Item { interval: notificationObject.expireTimeout ?? root.defaultTimeoutValue repeat: false onTriggered: { + root.notificationXAnimation = Appearance.animation.elementMoveExit Notifications.timeoutNotification(notificationObject.id); } } @@ -135,9 +138,11 @@ Item { dragStarted = false if (mouse.button === Qt.LeftButton) { if (notificationRowWrapper.x > dragConfirmThreshold) { + root.notificationXAnimation = Appearance.animation.elementMoveEnter Notifications.discardNotification(notificationObject.id); } else { // Animate back if not far enough + root.notificationXAnimation = Appearance.animation.elementMoveFast notificationRowWrapper.x = 0 notificationBackground.x = 0 } @@ -188,9 +193,9 @@ Item { Behavior on x { enabled: enableAnimation NumberAnimation { - duration: Appearance.animation.elementMoveFast.duration - easing.type: Appearance.animation.elementMoveFast.type - easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve + duration: root.notificationXAnimation.duration + easing.type: root.notificationXAnimation.type + easing.bezierCurve: root.notificationXAnimation.bezierCurve } } Behavior on height { @@ -228,9 +233,9 @@ Item { Behavior on x { enabled: enableAnimation NumberAnimation { - duration: Appearance.animation.elementMoveFast.duration - easing.type: Appearance.animation.elementMoveFast.type - easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve + duration: root.notificationXAnimation.duration + easing.type: root.notificationXAnimation.type + easing.bezierCurve: root.notificationXAnimation.bezierCurve } }