From ee124f5e04f39435b7c8cbaabc82f89a689a3847 Mon Sep 17 00:00:00 2001 From: purian23 Date: Sun, 15 Feb 2026 15:02:16 -0500 Subject: [PATCH] Expressive curves on swipe & btn height --- .../Center/KeyboardNavigatedNotificationList.qml | 10 +++++++++- .../Modules/Notifications/Center/NotificationCard.qml | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml b/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml index e6ef2df3..6214608f 100644 --- a/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml +++ b/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml @@ -138,6 +138,8 @@ DankListView { (index === listView.swipingCardIndex - 1 || index === listView.swipingCardIndex + 1) readonly property real adjacentSwipeInfluence: isAdjacentToSwipe ? listView.swipingCardOffset * 0.10 : 0 readonly property real adjacentScaleInfluence: isAdjacentToSwipe ? 1.0 - Math.abs(listView.swipingCardOffset) / width * 0.02 : 1.0 + readonly property real swipeFadeStartOffset: width * 0.75 + readonly property real swipeFadeDistance: Math.max(1, width - swipeFadeStartOffset) Component.onCompleted: { Qt.callLater(() => { @@ -159,7 +161,13 @@ DankListView { notificationGroup: modelData keyboardNavigationActive: listView.keyboardActive animateExpansion: listView.cardAnimateExpansion && listView.listInitialized - opacity: 1 - Math.abs(delegateRoot.swipeOffset) / (delegateRoot.width * 0.5) + opacity: { + const swipeAmount = Math.abs(delegateRoot.swipeOffset); + if (swipeAmount <= delegateRoot.swipeFadeStartOffset) + return 1; + const fadeProgress = (swipeAmount - delegateRoot.swipeFadeStartOffset) / delegateRoot.swipeFadeDistance; + return Math.max(0, 1 - fadeProgress); + } onIsAnimatingChanged: { if (isAnimating) { listView.isAnimatingExpansion = true; diff --git a/quickshell/Modules/Notifications/Center/NotificationCard.qml b/quickshell/Modules/Notifications/Center/NotificationCard.qml index 63f5a50b..e962f6c3 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCard.qml @@ -28,6 +28,7 @@ Rectangle { readonly property real cardPadding: compactMode ? Theme.notificationCardPaddingCompact : Theme.notificationCardPadding readonly property real iconSize: compactMode ? Theme.notificationIconSizeCompact : Theme.notificationIconSizeNormal readonly property real contentSpacing: compactMode ? Theme.spacingXS : Theme.spacingS + readonly property real collapsedDismissOffset: 5 readonly property real badgeSize: compactMode ? 16 : 18 readonly property real actionButtonHeight: compactMode ? 20 : 24 readonly property real collapsedContentHeight: Math.max(iconSize, Theme.fontSizeSmall * 1.2 + Theme.fontSizeMedium * 1.2 + Theme.fontSizeSmall * 1.2 * (compactMode ? 1 : 2)) @@ -833,7 +834,7 @@ Rectangle { anchors.right: parent.right anchors.rightMargin: Theme.spacingL anchors.top: collapsedContent.bottom - anchors.topMargin: contentSpacing + anchors.topMargin: contentSpacing + collapsedDismissOffset width: Math.max(collapsedClearText.implicitWidth + Theme.spacingM, Theme.notificationActionMinWidth) height: actionButtonHeight radius: Theme.notificationButtonCornerRadius