notifications: swipe right then collapse, smooth float-up for remaining

This commit is contained in:
Damocles 2026-04-13 15:15:33 +02:00
parent 22ea9b0df1
commit 369dee5335

View file

@ -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 {