From 1cd52d9a52d9e6959f63681f82bd2b2e011f09f2 Mon Sep 17 00:00:00 2001 From: lucy Date: Sat, 17 Jan 2026 23:19:54 +0100 Subject: [PATCH] add dismiss timer --- modules/notifications/NotiServer.qml | 1 - modules/notifications/Notification.qml | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/notifications/NotiServer.qml b/modules/notifications/NotiServer.qml index fb78786..d2e3efe 100644 --- a/modules/notifications/NotiServer.qml +++ b/modules/notifications/NotiServer.qml @@ -1,4 +1,3 @@ - pragma ComponentBehavior: Bound pragma Singleton import Quickshell.Services.Notifications diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml index f7f97b2..4a1f8ee 100644 --- a/modules/notifications/Notification.qml +++ b/modules/notifications/Notification.qml @@ -27,7 +27,9 @@ Variants { left: 10 } - mask: Region { item: notifList } + mask: Region { + item: notifList + } implicitHeight: notifList.contentHeight + 20 implicitWidth: modelData.width / 8 @@ -46,12 +48,18 @@ Variants { model: NotiServer.trackedNotifications delegate: Item { - anchors.right: parent ? parent.right : root.right id: notifyItem required property var index + required property var modelData + anchors.right: parent ? parent.right : root.anchors.right implicitWidth: root.modelData.width / 8 implicitHeight: notiIcon.implicitHeight + 20 - required property var modelData + Timer { + id: dismissTimer + interval: 5000 + running: true + onTriggered: parent.modelData.dismiss() + } Rectangle { anchors.fill: parent @@ -93,6 +101,7 @@ Variants { font.bold: true elide: Text.ElideRight Layout.fillWidth: true + onTextChanged: dismissTimer.restart() } Text {