mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-05 13:08:29 -04:00
feat(notifications): introduce notification foreground layers settings override
port 1.5
This commit is contained in:
@@ -862,6 +862,7 @@ Singleton {
|
|||||||
property bool notificationOverlayEnabled: false
|
property bool notificationOverlayEnabled: false
|
||||||
property bool notificationPopupShadowEnabled: true
|
property bool notificationPopupShadowEnabled: true
|
||||||
property bool notificationPopupPrivacyMode: false
|
property bool notificationPopupPrivacyMode: false
|
||||||
|
property bool notificationForegroundLayers: true
|
||||||
property int overviewRows: 2
|
property int overviewRows: 2
|
||||||
property int overviewColumns: 5
|
property int overviewColumns: 5
|
||||||
property real overviewScale: 0.16
|
property real overviewScale: 0.16
|
||||||
|
|||||||
@@ -580,11 +580,15 @@ Singleton {
|
|||||||
readonly property bool foregroundLayers: typeof SettingsData === "undefined" || (SettingsData.blurForegroundLayers ?? true)
|
readonly property bool foregroundLayers: typeof SettingsData === "undefined" || (SettingsData.blurForegroundLayers ?? true)
|
||||||
readonly property bool blurForegroundLayers: BlurService.enabled && foregroundLayers
|
readonly property bool blurForegroundLayers: BlurService.enabled && foregroundLayers
|
||||||
readonly property bool transparentBlurLayers: 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 readableSurface: withAlpha(surfaceContainer, popupTransparency)
|
||||||
readonly property color readableSurfaceHigh: withAlpha(surfaceContainerHigh, popupTransparency)
|
readonly property color readableSurfaceHigh: withAlpha(surfaceContainerHigh, popupTransparency)
|
||||||
readonly property color floatingSurface: foregroundLayers ? readableSurface : withAlpha(readableSurface, 0)
|
readonly property color floatingSurface: foregroundLayers ? readableSurface : withAlpha(readableSurface, 0)
|
||||||
readonly property color floatingSurfaceHigh: foregroundLayers ? readableSurfaceHigh : withAlpha(readableSurfaceHigh, 0)
|
readonly property color floatingSurfaceHigh: foregroundLayers ? readableSurfaceHigh : withAlpha(readableSurfaceHigh, 0)
|
||||||
readonly property color nestedSurface: floatingSurfaceHigh
|
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 blurLayerOutlineOpacity: Math.max(0, Math.min(1, typeof SettingsData === "undefined" ? 0.12 : (SettingsData.blurLayerOutlineOpacity ?? 0.12)))
|
||||||
readonly property real layerOutlineOpacity: blurLayerOutlineOpacity
|
readonly property real layerOutlineOpacity: blurLayerOutlineOpacity
|
||||||
readonly property int layerOutlineWidth: layerOutlineOpacity > 0 ? 1 : 0
|
readonly property int layerOutlineWidth: layerOutlineOpacity > 0 ? 1 : 0
|
||||||
|
|||||||
@@ -439,6 +439,7 @@ var SPEC = {
|
|||||||
notificationOverlayEnabled: { def: false },
|
notificationOverlayEnabled: { def: false },
|
||||||
notificationPopupShadowEnabled: { def: true },
|
notificationPopupShadowEnabled: { def: true },
|
||||||
notificationPopupPrivacyMode: { def: false },
|
notificationPopupPrivacyMode: { def: false },
|
||||||
|
notificationForegroundLayers: { def: true },
|
||||||
overviewRows: { def: 2, persist: false },
|
overviewRows: { def: 2, persist: false },
|
||||||
overviewColumns: { def: 5, persist: false },
|
overviewColumns: { def: 5, persist: false },
|
||||||
overviewScale: { def: 0.16, persist: false },
|
overviewScale: { def: 0.16, persist: false },
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Rectangle {
|
|||||||
color: {
|
color: {
|
||||||
if (isSelected && keyboardNavigationActive)
|
if (isSelected && keyboardNavigationActive)
|
||||||
return Theme.primaryPressed;
|
return Theme.primaryPressed;
|
||||||
return Theme.floatingSurfaceHigh;
|
return Theme.notificationFloatingSurfaceHigh;
|
||||||
}
|
}
|
||||||
border.color: {
|
border.color: {
|
||||||
if (isSelected && keyboardNavigationActive)
|
if (isSelected && keyboardNavigationActive)
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ Rectangle {
|
|||||||
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
|
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
|
||||||
return Theme.primaryHoverLight;
|
return Theme.primaryHoverLight;
|
||||||
}
|
}
|
||||||
return Theme.floatingSurfaceHigh;
|
return Theme.notificationFloatingSurfaceHigh;
|
||||||
}
|
}
|
||||||
border.color: {
|
border.color: {
|
||||||
if (isGroupSelected && keyboardNavigationActive) {
|
if (isGroupSelected && keyboardNavigationActive) {
|
||||||
@@ -583,7 +583,7 @@ Rectangle {
|
|||||||
return expandedBaseHeight;
|
return expandedBaseHeight;
|
||||||
}
|
}
|
||||||
radius: Theme.cornerRadius
|
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.color: isSelected ? Theme.withAlpha(Theme.primary, 0.4) : Theme.outlineMedium
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
|
|||||||
@@ -676,7 +676,7 @@ PanelWindow {
|
|||||||
sourceWidth: Math.max(0, content.width - (content.cardInset * 2))
|
sourceWidth: Math.max(0, content.width - (content.cardInset * 2))
|
||||||
sourceHeight: Math.max(0, content.height - (content.cardInset * 2))
|
sourceHeight: Math.max(0, content.height - (content.cardInset * 2))
|
||||||
targetRadius: win.connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
|
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)
|
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
|
borderWidth: win.notificationData && win.notificationData.urgency === NotificationUrgency.Critical ? 2 : 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,6 +299,15 @@ Item {
|
|||||||
onToggled: checked => SettingsData.set("notificationCompactMode", checked)
|
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 {
|
SettingsToggleRow {
|
||||||
settingKey: "notificationShowTimeoutBar"
|
settingKey: "notificationShowTimeoutBar"
|
||||||
tags: ["notification", "timeout", "progress", "bar", "timer", "countdown"]
|
tags: ["notification", "timeout", "progress", "bar", "timer", "countdown"]
|
||||||
|
|||||||
@@ -6048,6 +6048,31 @@
|
|||||||
"toast"
|
"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",
|
"section": "notificationHistoryMaxAgeDays",
|
||||||
"label": "History Retention",
|
"label": "History Retention",
|
||||||
|
|||||||
Reference in New Issue
Block a user