animate popup auto-expire: swipe out instead of instant vanish
This commit is contained in:
parent
03c545c9d1
commit
2c5cf8c174
2 changed files with 12 additions and 1 deletions
|
|
@ -63,6 +63,14 @@ PanelWindow {
|
||||||
_entered = true;
|
_entered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: M.NotifService
|
||||||
|
function onPopupExpiring(notifId) {
|
||||||
|
if (notifId === popupItem.modelData.id)
|
||||||
|
popupItem.animateDismiss(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
enabled: popupItem._entered
|
enabled: popupItem._entered
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
|
||||||
|
|
@ -105,12 +105,15 @@ QtObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Signal popups to animate out before removal
|
||||||
|
signal popupExpiring(var notifId)
|
||||||
|
|
||||||
property Component _expireTimer: Component {
|
property Component _expireTimer: Component {
|
||||||
Timer {
|
Timer {
|
||||||
property var _notifId
|
property var _notifId
|
||||||
running: true
|
running: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.dismissPopup(_notifId);
|
root.popupExpiring(_notifId);
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue