diff options
Diffstat (limited to 'modules/notifications')
| -rw-r--r-- | modules/notifications/Content.qml | 2 | ||||
| -rw-r--r-- | modules/notifications/Notification.qml | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml index 828c3a8..019e922 100644 --- a/modules/notifications/Content.qml +++ b/modules/notifications/Content.qml @@ -55,7 +55,7 @@ Item { id: list model: ScriptModel { - values: [...Notifs.popups].reverse() + values: Notifs.popups.filter(n => !n.closed).reverse() } anchors.fill: parent diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml index 2d56ef6..95507fc 100644 --- a/modules/notifications/Notification.qml +++ b/modules/notifications/Notification.qml @@ -26,7 +26,11 @@ StyledRect { implicitHeight: inner.implicitHeight x: Config.notifs.sizes.width - Component.onCompleted: x = 0 + Component.onCompleted: { + x = 0; + modelData.lock(this); + } + Component.onDestruction: modelData.unlock(this) Behavior on x { Anim { @@ -34,11 +38,6 @@ StyledRect { } } - RetainableLock { - object: root.modelData.notification - locked: true - } - MouseArea { property int startY @@ -61,7 +60,7 @@ StyledRect { root.modelData.timer.stop(); startY = event.y; if (event.button === Qt.MiddleButton) - root.modelData.notification.dismiss(); + root.modelData.close(); } onReleased: event => { if (!containsMouse) @@ -70,7 +69,7 @@ StyledRect { if (Math.abs(root.x) < Config.notifs.sizes.width * Config.notifs.clearThreshold) root.x = 0; else - root.modelData.notification.dismiss(); // TODO: change back to popup when notif dock impled + root.modelData.popup = false; } onPositionChanged: event => { if (pressed) { @@ -393,7 +392,7 @@ StyledRect { return; Quickshell.execDetached(["app2unit", "-O", "--", link]); - root.modelData.notification.dismiss(); // TODO: change back to popup when notif dock impled + root.modelData.popup = false; } opacity: root.expanded ? 1 : 0 @@ -422,7 +421,7 @@ StyledRect { modelData: QtObject { readonly property string text: qsTr("Close") function invoke(): void { - root.modelData.notification.dismiss(); + root.modelData.close(); } } } |