notifications: swipe right then collapse, smooth float-up for remaining
This commit is contained in:
parent
22ea9b0df1
commit
369dee5335
1 changed files with 35 additions and 17 deletions
|
|
@ -48,7 +48,19 @@ PanelWindow {
|
||||||
readonly property real _targetHeight: contentCol.height + 16
|
readonly property real _targetHeight: contentCol.height + 16
|
||||||
property real _heightScale: 0
|
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 {
|
ParallelAnimation {
|
||||||
id: slideIn
|
id: slideIn
|
||||||
|
|
@ -217,30 +229,36 @@ PanelWindow {
|
||||||
slideOut.start();
|
slideOut.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
ParallelAnimation {
|
SequentialAnimation {
|
||||||
id: slideOut
|
id: slideOut
|
||||||
NumberAnimation {
|
// Swipe right
|
||||||
target: popupItem
|
ParallelAnimation {
|
||||||
property: "opacity"
|
NumberAnimation {
|
||||||
to: 0
|
target: popupItem
|
||||||
duration: 200
|
property: "x"
|
||||||
easing.type: Easing.InCubic
|
to: 400
|
||||||
}
|
duration: 250
|
||||||
NumberAnimation {
|
easing.type: Easing.InCubic
|
||||||
target: popupItem
|
}
|
||||||
property: "x"
|
NumberAnimation {
|
||||||
to: 320
|
target: popupItem
|
||||||
duration: 250
|
property: "opacity"
|
||||||
easing.type: Easing.InCubic
|
to: 0
|
||||||
|
duration: 250
|
||||||
|
easing.type: Easing.InCubic
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Collapse height so items below float up
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: popupItem
|
target: popupItem
|
||||||
property: "_heightScale"
|
property: "_heightScale"
|
||||||
to: 0
|
to: 0
|
||||||
duration: 200
|
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 {
|
MouseArea {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue