From 8944762c76010a8742095de0b82ca91153d9666f Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 5 Feb 2026 15:17:17 -0500 Subject: [PATCH] notifications: cap max anim speed in popout --- .../Center/KeyboardNavigatedNotificationList.qml | 2 ++ .../Notifications/Center/NotificationCard.qml | 3 ++- .../Center/NotificationCenterPopout.qml | 13 +++++++++++++ .../Notifications/Center/NotificationSettings.qml | 10 ++++------ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml b/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml index 160ded41..846059e0 100644 --- a/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml +++ b/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml @@ -12,6 +12,7 @@ DankListView { property bool isAnimatingExpansion: false property alias count: listView.count property alias listContentHeight: listView.contentHeight + property bool cardAnimateExpansion: true clip: true model: NotificationService.groupedNotifications @@ -88,6 +89,7 @@ DankListView { x: delegateRoot.swipeOffset notificationGroup: modelData keyboardNavigationActive: listView.keyboardActive + animateExpansion: listView.cardAnimateExpansion opacity: 1 - Math.abs(delegateRoot.swipeOffset) / (delegateRoot.width * 0.5) onIsAnimatingChanged: { if (isAnimating) { diff --git a/quickshell/Modules/Notifications/Center/NotificationCard.qml b/quickshell/Modules/Notifications/Center/NotificationCard.qml index 3a00bab8..721d31f6 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCard.qml @@ -13,6 +13,7 @@ Rectangle { property bool descriptionExpanded: (NotificationService.expandedMessages[(notificationGroup && notificationGroup.latestNotification && notificationGroup.latestNotification.notification && notificationGroup.latestNotification.notification.id) ? (notificationGroup.latestNotification.notification.id + "_desc") : ""] || false) property bool userInitiatedExpansion: false property bool isAnimating: false + property bool animateExpansion: true property bool isGroupSelected: false property int selectedNotificationIndex: -1 @@ -715,7 +716,7 @@ Rectangle { } Behavior on height { - enabled: root.userInitiatedExpansion + enabled: root.userInitiatedExpansion && root.animateExpansion NumberAnimation { duration: Theme.mediumDuration easing.type: Theme.emphasizedEasing diff --git a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml index b2413735..3e268abf 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml @@ -10,6 +10,7 @@ DankPopout { property bool notificationHistoryVisible: false property var triggerScreen: null + property bool _animatePopupHeight: false NotificationKeyboardController { id: keyboardController @@ -23,6 +24,14 @@ DankPopout { popupWidth: 400 popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400 positioning: "" + + Behavior on popupHeight { + enabled: root._animatePopupHeight + NumberAnimation { + duration: Math.min(Theme.shortDuration, 150) + easing.type: Theme.emphasizedEasing + } + } screen: triggerScreen shouldBeVisible: notificationHistoryVisible @@ -72,10 +81,13 @@ DankPopout { onShouldBeVisibleChanged: { if (shouldBeVisible) { + _animatePopupHeight = false; NotificationService.onOverlayOpen(); if (contentLoader.item) Qt.callLater(setupKeyboardNavigation); + Qt.callLater(() => { root._animatePopupHeight = true; }); } else { + _animatePopupHeight = false; NotificationService.onOverlayClose(); keyboardController.keyboardNavigationActive = false; } @@ -198,6 +210,7 @@ DankPopout { visible: notificationHeader.currentTab === 0 width: parent.width height: parent.height - notificationContent.cachedHeaderHeight - notificationSettings.height - contentColumnInner.spacing * 2 + cardAnimateExpansion: false } HistoryNotificationList { diff --git a/quickshell/Modules/Notifications/Center/NotificationSettings.qml b/quickshell/Modules/Notifications/Center/NotificationSettings.qml index 19473539..38e40341 100644 --- a/quickshell/Modules/Notifications/Center/NotificationSettings.qml +++ b/quickshell/Modules/Notifications/Center/NotificationSettings.qml @@ -19,18 +19,16 @@ Rectangle { Behavior on height { NumberAnimation { - duration: Anims.durShort - easing.type: Easing.BezierSpline - easing.bezierCurve: Anims.emphasized + duration: Theme.shortDuration + easing.type: Theme.emphasizedEasing } } opacity: expanded ? 1 : 0 Behavior on opacity { NumberAnimation { - duration: Anims.durShort - easing.type: Easing.BezierSpline - easing.bezierCurve: Anims.emphasized + duration: Theme.shortDuration + easing.type: Theme.emphasizedEasing } }