summaryrefslogtreecommitdiff
path: root/modules/notifications/Notification.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-18 23:39:23 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-18 23:39:23 +1000
commitef5936d0ab58b79d55d79da0c77627f09676691d (patch)
tree04a21d49d00d912b23a1665dc5ac1fc4492c6aee /modules/notifications/Notification.qml
parentsidebar: add notifs (diff)
downloadcaelestia-shell-ef5936d0ab58b79d55d79da0c77627f09676691d.tar.gz
caelestia-shell-ef5936d0ab58b79d55d79da0c77627f09676691d.tar.bz2
caelestia-shell-ef5936d0ab58b79d55d79da0c77627f09676691d.zip
notifs: persistent notifs + better sidebar notifs
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();
}
}
}