From 3c688cfbd3cfbb31fb3db25e57a7c9ededb89b1b Mon Sep 17 00:00:00 2001 From: purian23 Date: Fri, 17 Jul 2026 13:17:12 -0400 Subject: [PATCH] feat(notifications): introduce notification foreground layers settings override port 1.5 --- quickshell/Common/SettingsData.qml | 1 + quickshell/Common/Theme.qml | 4 +++ quickshell/Common/settings/SettingsSpec.js | 1 + .../Center/HistoryNotificationCard.qml | 2 +- .../Notifications/Center/NotificationCard.qml | 4 +-- .../Notifications/Popup/NotificationPopup.qml | 2 +- .../Modules/Settings/NotificationsTab.qml | 9 +++++++ .../translations/settings_search_index.json | 25 +++++++++++++++++++ 8 files changed, 44 insertions(+), 4 deletions(-) diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index 2695aba03..1a0929166 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -862,6 +862,7 @@ Singleton { property bool notificationOverlayEnabled: false property bool notificationPopupShadowEnabled: true property bool notificationPopupPrivacyMode: false + property bool notificationForegroundLayers: true property int overviewRows: 2 property int overviewColumns: 5 property real overviewScale: 0.16 diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index 3bcae6c9a..e51108e7c 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -580,11 +580,15 @@ Singleton { readonly property bool foregroundLayers: typeof SettingsData === "undefined" || (SettingsData.blurForegroundLayers ?? true) readonly property bool blurForegroundLayers: BlurService.enabled && foregroundLayers readonly property bool transparentBlurLayers: BlurService.enabled && !foregroundLayers + readonly property bool notificationForegroundLayers: typeof SettingsData === "undefined" || (SettingsData.notificationForegroundLayers ?? true) readonly property color readableSurface: withAlpha(surfaceContainer, popupTransparency) readonly property color readableSurfaceHigh: withAlpha(surfaceContainerHigh, popupTransparency) readonly property color floatingSurface: foregroundLayers ? readableSurface : withAlpha(readableSurface, 0) readonly property color floatingSurfaceHigh: foregroundLayers ? readableSurfaceHigh : withAlpha(readableSurfaceHigh, 0) readonly property color nestedSurface: floatingSurfaceHigh + readonly property color notificationFloatingSurface: notificationForegroundLayers ? readableSurface : withAlpha(readableSurface, 0) + readonly property color notificationFloatingSurfaceHigh: notificationForegroundLayers ? readableSurfaceHigh : withAlpha(readableSurfaceHigh, 0) + readonly property color notificationNestedSurface: notificationFloatingSurfaceHigh readonly property real blurLayerOutlineOpacity: Math.max(0, Math.min(1, typeof SettingsData === "undefined" ? 0.12 : (SettingsData.blurLayerOutlineOpacity ?? 0.12))) readonly property real layerOutlineOpacity: blurLayerOutlineOpacity readonly property int layerOutlineWidth: layerOutlineOpacity > 0 ? 1 : 0 diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index ea0e48bcf..2173a4645 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -439,6 +439,7 @@ var SPEC = { notificationOverlayEnabled: { def: false }, notificationPopupShadowEnabled: { def: true }, notificationPopupPrivacyMode: { def: false }, + notificationForegroundLayers: { def: true }, overviewRows: { def: 2, persist: false }, overviewColumns: { def: 5, persist: false }, overviewScale: { def: 0.16, persist: false }, diff --git a/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml b/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml index 2d283393a..7e51e945a 100644 --- a/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml @@ -49,7 +49,7 @@ Rectangle { color: { if (isSelected && keyboardNavigationActive) return Theme.primaryPressed; - return Theme.floatingSurfaceHigh; + return Theme.notificationFloatingSurfaceHigh; } border.color: { if (isSelected && keyboardNavigationActive) diff --git a/quickshell/Modules/Notifications/Center/NotificationCard.qml b/quickshell/Modules/Notifications/Center/NotificationCard.qml index 7685cd2dc..5499ec06c 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCard.qml @@ -153,7 +153,7 @@ Rectangle { if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) { return Theme.primaryHoverLight; } - return Theme.floatingSurfaceHigh; + return Theme.notificationFloatingSurfaceHigh; } border.color: { if (isGroupSelected && keyboardNavigationActive) { @@ -583,7 +583,7 @@ Rectangle { return expandedBaseHeight; } radius: Theme.cornerRadius - color: isSelected ? Theme.primaryPressed : Theme.nestedSurface + color: isSelected ? Theme.primaryPressed : Theme.notificationNestedSurface border.color: isSelected ? Theme.withAlpha(Theme.primary, 0.4) : Theme.outlineMedium border.width: 1 diff --git a/quickshell/Modules/Notifications/Popup/NotificationPopup.qml b/quickshell/Modules/Notifications/Popup/NotificationPopup.qml index 501a5844f..5896e9867 100644 --- a/quickshell/Modules/Notifications/Popup/NotificationPopup.qml +++ b/quickshell/Modules/Notifications/Popup/NotificationPopup.qml @@ -676,7 +676,7 @@ PanelWindow { sourceWidth: Math.max(0, content.width - (content.cardInset * 2)) sourceHeight: Math.max(0, content.height - (content.cardInset * 2)) targetRadius: win.connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius - targetColor: win.connectedFrameMode ? Theme.floatingSurface : Theme.readableSurface + targetColor: win.connectedFrameMode ? Theme.notificationFloatingSurface : Theme.readableSurface borderColor: win.notificationData && win.notificationData.urgency === NotificationUrgency.Critical ? Theme.withAlpha(Theme.primary, 0.3) : Theme.withAlpha(Theme.outline, 0.08) borderWidth: win.notificationData && win.notificationData.urgency === NotificationUrgency.Critical ? 2 : 0 } diff --git a/quickshell/Modules/Settings/NotificationsTab.qml b/quickshell/Modules/Settings/NotificationsTab.qml index 69c9b6602..7b7c72c52 100644 --- a/quickshell/Modules/Settings/NotificationsTab.qml +++ b/quickshell/Modules/Settings/NotificationsTab.qml @@ -299,6 +299,15 @@ Item { onToggled: checked => SettingsData.set("notificationCompactMode", checked) } + SettingsToggleRow { + settingKey: "notificationForegroundLayers" + tags: ["notification", "foreground", "layers", "surface", "blur", "glass", "contrast", "cards"] + text: I18n.tr("Foreground Layers") + description: I18n.tr("Show foreground surfaces on notification cards") + checked: SettingsData.notificationForegroundLayers ?? true + onToggled: checked => SettingsData.set("notificationForegroundLayers", checked) + } + SettingsToggleRow { settingKey: "notificationShowTimeoutBar" tags: ["notification", "timeout", "progress", "bar", "timer", "countdown"] diff --git a/quickshell/translations/settings_search_index.json b/quickshell/translations/settings_search_index.json index 3e66d1e27..b6588b338 100644 --- a/quickshell/translations/settings_search_index.json +++ b/quickshell/translations/settings_search_index.json @@ -6048,6 +6048,31 @@ "toast" ] }, + { + "section": "notificationForegroundLayers", + "label": "Foreground Layers", + "tabIndex": 17, + "category": "Notifications", + "keywords": [ + "alert", + "alerts", + "blur", + "cards", + "contrast", + "foreground", + "glass", + "layers", + "messages", + "notif", + "notification", + "notifications", + "show", + "surface", + "surfaces", + "toast" + ], + "description": "Show foreground surfaces on notification cards" + }, { "section": "notificationHistoryMaxAgeDays", "label": "History Retention",