From f9810413c6aff247b63d8321812a98f204eb0b49 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 13 Sep 2025 17:26:41 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell/Lockscreen.qml | 4 ++++ accounts/gkleen@sif/shell/quickshell/NotificationDisplay.qml | 2 +- .../shell/quickshell/NotificationInhibitorWidget.qml | 11 ++++++++--- .../shell/quickshell/Services/NotificationManager.qml | 4 +++- accounts/gkleen@sif/shell/quickshell/UnixIPC.qml | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell') diff --git a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml index 880e6614..8c5082a1 100644 --- a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml +++ b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml @@ -70,6 +70,10 @@ Scope { mode: Custom.SystemdInhibitorParams.Delay } + Bindings { + NotificationManager.lockscreenActive: lock.locked + } + WlSessionLock { id: lock diff --git a/accounts/gkleen@sif/shell/quickshell/NotificationDisplay.qml b/accounts/gkleen@sif/shell/quickshell/NotificationDisplay.qml index a727b044..03406687 100644 --- a/accounts/gkleen@sif/shell/quickshell/NotificationDisplay.qml +++ b/accounts/gkleen@sif/shell/quickshell/NotificationDisplay.qml @@ -15,7 +15,7 @@ Scope { id: notifsRepeater model: ScriptModel { - values: NotificationManager.displayInhibited ? [] : NotificationManager.groups + values: NotificationManager.active ? [] : NotificationManager.groups } delegate: PanelWindow { diff --git a/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml index 1005182a..26ac4bde 100644 --- a/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml +++ b/accounts/gkleen@sif/shell/quickshell/NotificationInhibitorWidget.qml @@ -41,8 +41,13 @@ Item { implicitSize: 14 anchors.centerIn: parent - icon: NotificationManager.displayInhibited ? "message-off" : "message" - color: NotificationManager.displayInhibited ? "white" : "#555" + icon: NotificationManager.active ? "message" : "message-off" + color: { + if (!NotificationManager.active && !NotificationManager.displayInhibited) + return "#f28a21"; + if (NotificationManager.displayInhibited) + return "white"; + return "#555"; } } } @@ -64,7 +69,7 @@ Item { sourceComponent: PopupWindow { id: tooltip - property bool nextVisible: !NotificationManager.displayInhibited && (widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse) + property bool nextVisible: NotificationManager.active && (widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse) anchor { item: widgetMouseArea diff --git a/accounts/gkleen@sif/shell/quickshell/Services/NotificationManager.qml b/accounts/gkleen@sif/shell/quickshell/Services/NotificationManager.qml index 2199ccdf..001ffcf5 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/NotificationManager.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/NotificationManager.qml @@ -7,6 +7,8 @@ import Quickshell.Services.Notifications Singleton { id: root + readonly property bool active: !lockscreenActive && !displayInhibited + property bool lockscreenActive: false property bool displayInhibited: false property alias trackedNotifications: server.trackedNotifications readonly property var groups: { @@ -68,7 +70,7 @@ Singleton { required property int expirationTime property list data: [ Timer { - running: !root.displayInhibited + running: root.active interval: timer.expirationTime onTriggered: timer.parent.expire() } diff --git a/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml b/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml index e19ccfb1..05a40dbc 100644 --- a/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml +++ b/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml @@ -84,12 +84,12 @@ Scope { Component.onCompleted: { (_ => {})(MprisProxy.players); } function onCommandNotifications(command) { - if (command.DismissGroup && !NotificationManager.displayInhibited) { + if (command.DismissGroup && NotificationManager.active) { if (NotificationManager.groups.length > 0) for (const notif of [...NotificationManager.groups[0]]) notif.dismiss(); } - if (command.DismissAll && !NotificationManager.displayInhibited) { + if (command.DismissAll && NotificationManager.active) { for (const notif of [...NotificationManager.trackedNotifications.values]) notif.dismiss(); } -- cgit v1.2.3