From 7021061ffd98b32b3a14e66c6bcff3787f998f3a Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 5 Aug 2025 07:22:33 -0400 Subject: [PATCH] notifs/dock on TopLayer --- Modules/Dock/Dock.qml | 2 +- Modules/Notifications/Center/NotificationCard.qml | 7 ++++--- Modules/Notifications/Popup/NotificationPopup.qml | 9 +++++---- Services/NotificationService.qml | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 362725fc..1b642ca7 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -10,7 +10,7 @@ import qs.Widgets PanelWindow { id: dock - WlrLayershell.layer: WlrLayershell.Overlay + WlrLayershell.layer: WlrLayershell.TopLayer WlrLayershell.exclusiveZone: -1 WlrLayershell.keyboardFocus: WlrKeyboardFocus.None diff --git a/Modules/Notifications/Center/NotificationCard.qml b/Modules/Notifications/Center/NotificationCard.qml index 25ce237c..25512bd3 100644 --- a/Modules/Notifications/Center/NotificationCard.qml +++ b/Modules/Notifications/Center/NotificationCard.qml @@ -2,6 +2,7 @@ import QtQuick import QtQuick.Controls import Quickshell import Quickshell.Widgets +import Quickshell.Services.Notifications import qs.Common import qs.Services import qs.Widgets @@ -27,14 +28,14 @@ Rectangle { } radius: Theme.cornerRadiusLarge color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.1) - border.color: notificationGroup?.latestNotification?.urgency === 2 ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05) - border.width: notificationGroup?.latestNotification?.urgency === 2 ? 2 : 1 + border.color: notificationGroup?.latestNotification?.urgency === NotificationUrgency.Critical ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05) + border.width: notificationGroup?.latestNotification?.urgency === NotificationUrgency.Critical ? 2 : 1 clip: true Rectangle { anchors.fill: parent radius: parent.radius - visible: notificationGroup?.latestNotification?.urgency === 2 + visible: notificationGroup?.latestNotification?.urgency === NotificationUrgency.Critical gradient: Gradient { orientation: Gradient.Horizontal GradientStop { diff --git a/Modules/Notifications/Popup/NotificationPopup.qml b/Modules/Notifications/Popup/NotificationPopup.qml index 8c05d3b7..df132f1f 100644 --- a/Modules/Notifications/Popup/NotificationPopup.qml +++ b/Modules/Notifications/Popup/NotificationPopup.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import Quickshell import Quickshell.Wayland import Quickshell.Widgets +import Quickshell.Services.Notifications import qs.Common import qs.Services import qs.Widgets @@ -57,7 +58,7 @@ PanelWindow { } visible: hasValidData - WlrLayershell.layer: WlrLayershell.Overlay + WlrLayershell.layer: notificationData && notificationData.urgency === NotificationUrgency.Critical ? WlrLayershell.Overlay : WlrLayershell.TopLayer WlrLayershell.exclusiveZone: -1 WlrLayershell.keyboardFocus: WlrKeyboardFocus.None color: "transparent" @@ -124,8 +125,8 @@ PanelWindow { anchors.margins: 4 radius: Theme.cornerRadiusLarge color: Theme.popupBackground() - border.color: notificationData && notificationData.urgency === 2 ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08) - border.width: notificationData && notificationData.urgency === 2 ? 2 : 1 + border.color: notificationData && notificationData.urgency === NotificationUrgency.Critical ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08) + border.width: notificationData && notificationData.urgency === NotificationUrgency.Critical ? 2 : 1 clip: true Rectangle { @@ -166,7 +167,7 @@ PanelWindow { Rectangle { anchors.fill: parent radius: parent.radius - visible: notificationData && notificationData.urgency === 2 + visible: notificationData && notificationData.urgency === NotificationUrgency.Critical opacity: 1 gradient: Gradient { diff --git a/Services/NotificationService.qml b/Services/NotificationService.qml index 9ee1982d..44463600 100644 --- a/Services/NotificationService.qml +++ b/Services/NotificationService.qml @@ -310,8 +310,8 @@ Singleton { } return Object.values(groups).sort((a, b) => { - const aUrgency = a.latestNotification.urgency || 0; - const bUrgency = b.latestNotification.urgency || 0; + const aUrgency = a.latestNotification.urgency || NotificationUrgency.Low; + const bUrgency = b.latestNotification.urgency || NotificationUrgency.Low; if (aUrgency !== bUrgency) { return bUrgency - aUrgency; }