From 369dee533558cf00cad2317bcbf33900ea688296 Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 13 Apr 2026 15:15:33 +0200 Subject: [PATCH] notifications: swipe right then collapse, smooth float-up for remaining --- modules/NotifPopup.qml | 52 ++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/modules/NotifPopup.qml b/modules/NotifPopup.qml index f2fc884..0e99743 100644 --- a/modules/NotifPopup.qml +++ b/modules/NotifPopup.qml @@ -48,7 +48,19 @@ PanelWindow { readonly property real _targetHeight: contentCol.height + 16 property real _heightScale: 0 - Component.onCompleted: slideIn.start() + property bool _entered: false + Component.onCompleted: { + _entered = true; + slideIn.start(); + } + + Behavior on y { + enabled: popupItem._entered + NumberAnimation { + duration: 200 + easing.type: Easing.OutCubic + } + } ParallelAnimation { id: slideIn @@ -217,30 +229,36 @@ PanelWindow { slideOut.start(); } - ParallelAnimation { + SequentialAnimation { id: slideOut - NumberAnimation { - target: popupItem - property: "opacity" - to: 0 - duration: 200 - easing.type: Easing.InCubic - } - NumberAnimation { - target: popupItem - property: "x" - to: 320 - duration: 250 - easing.type: Easing.InCubic + // Swipe right + ParallelAnimation { + NumberAnimation { + target: popupItem + property: "x" + to: 400 + duration: 250 + easing.type: Easing.InCubic + } + NumberAnimation { + target: popupItem + property: "opacity" + to: 0 + duration: 250 + easing.type: Easing.InCubic + } } + // Collapse height so items below float up NumberAnimation { target: popupItem property: "_heightScale" to: 0 duration: 200 - easing.type: Easing.InCubic + easing.type: Easing.OutCubic + } + ScriptAction { + script: popupItem._fullDismiss ? M.NotifService.dismiss(popupItem.modelData.id) : M.NotifService.dismissPopup(popupItem.modelData.id) } - onFinished: popupItem._fullDismiss ? M.NotifService.dismiss(popupItem.modelData.id) : M.NotifService.dismissPopup(popupItem.modelData.id) } MouseArea {