notification animations: slide-in/out popups, staggered center fade, dismiss fade

This commit is contained in:
Damocles 2026-04-13 00:55:04 +02:00
parent b5b2276ff1
commit 608da78cea
2 changed files with 71 additions and 8 deletions

View file

@ -40,13 +40,15 @@ PanelWindow {
required property int index
width: popupCol.width
height: contentCol.height + 16
height: _targetHeight * _heightScale
opacity: 0
x: 50
x: 320
clip: true
Component.onCompleted: {
slideIn.start();
}
readonly property real _targetHeight: contentCol.height + 16
property real _heightScale: 0
Component.onCompleted: slideIn.start()
ParallelAnimation {
id: slideIn
@ -54,13 +56,21 @@ PanelWindow {
target: popupItem
property: "opacity"
to: 1
duration: 200
duration: 250
easing.type: Easing.OutCubic
}
NumberAnimation {
target: popupItem
property: "x"
to: 0
duration: 350
easing.type: Easing.OutBack
easing.overshoot: 0.5
}
NumberAnimation {
target: popupItem
property: "_heightScale"
to: 1
duration: 250
easing.type: Easing.OutCubic
}
@ -200,11 +210,41 @@ PanelWindow {
}
}
ParallelAnimation {
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
}
NumberAnimation {
target: popupItem
property: "_heightScale"
to: 0
duration: 200
easing.type: Easing.InCubic
}
onFinished: M.NotifService.dismissPopup(popupItem.modelData.id)
}
function animateDismiss() {
slideOut.start();
}
// Click to dismiss
MouseArea {
anchors.fill: parent
z: -1
onClicked: M.NotifService.dismissPopup(popupItem.modelData.id)
onClicked: popupItem.animateDismiss()
}
}
}