fix dismiss-all cascade, fix notification timeout type mismatch

This commit is contained in:
Damocles 2026-04-13 15:49:07 +02:00
parent 61b49a6aa8
commit 0c89b570ac
2 changed files with 10 additions and 10 deletions

View file

@ -69,13 +69,9 @@ M.PopupPanel {
function _cascadeDismiss() { function _cascadeDismiss() {
const dels = _delegates.filter(d => d && d.modelData && !d.modelData.closed); const dels = _delegates.filter(d => d && d.modelData && !d.modelData.closed);
for (let i = 0; i < dels.length; i++) { for (let i = 0; i < dels.length; i++) {
const d = dels[i]; _cascadeTimer.createObject(menuWindow, {
const delay = i * 60; _target: dels[i],
Qt.callLater(() => { _delay: i * 60
_cascadeTimer.createObject(menuWindow, {
_target: d,
_delay: delay
});
}); });
} }
} }
@ -87,8 +83,8 @@ M.PopupPanel {
interval: _delay interval: _delay
running: true running: true
onTriggered: { onTriggered: {
if (_target && _target._dismissAnim) if (_target && _target.dismiss)
_target._dismissAnim.start(); _target.dismiss();
destroy(); destroy();
} }
} }
@ -119,6 +115,10 @@ M.PopupPanel {
readonly property real _targetHeight: notifContent.height + 12 readonly property real _targetHeight: notifContent.height + 12
property real _heightScale: 1 property real _heightScale: 1
function dismiss() {
_dismissAnim.start();
}
Component.onCompleted: { Component.onCompleted: {
menuWindow._delegates.push(notifItem); menuWindow._delegates.push(notifItem);
fadeIn.start(); fadeIn.start();

View file

@ -107,7 +107,7 @@ QtObject {
property Component _expireTimer: Component { property Component _expireTimer: Component {
Timer { Timer {
property string _notifId property var _notifId
running: true running: true
onTriggered: { onTriggered: {
root.dismissPopup(_notifId); root.dismissPopup(_notifId);