summaryrefslogtreecommitdiff
path: root/modules/notifications/Notification.qml
diff options
context:
space:
mode:
Diffstat (limited to 'modules/notifications/Notification.qml')
-rw-r--r--modules/notifications/Notification.qml19
1 files changed, 9 insertions, 10 deletions
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();
}
}
}