mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-26 14:32:52 -05:00
feat: Opt to display notifications over fullscreen apps
This commit is contained in:
@@ -58,8 +58,17 @@ PanelWindow {
|
||||
}
|
||||
|
||||
visible: hasValidData
|
||||
WlrLayershell.layer: notificationData && notificationData.urgency
|
||||
=== NotificationUrgency.Critical ? WlrLayershell.Overlay : WlrLayershell.Top
|
||||
WlrLayershell.layer: {
|
||||
if (!notificationData) return WlrLayershell.Top
|
||||
|
||||
SettingsData.notificationOverlayEnabled
|
||||
|
||||
// If overlay is enabled for all notifications, or if it's a critical notification
|
||||
const shouldUseOverlay = (SettingsData.notificationOverlayEnabled) ||
|
||||
(notificationData.urgency === NotificationUrgency.Critical)
|
||||
|
||||
return shouldUseOverlay ? WlrLayershell.Overlay : WlrLayershell.Top
|
||||
}
|
||||
WlrLayershell.exclusiveZone: -1
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||
color: "transparent"
|
||||
|
||||
@@ -45,6 +45,11 @@ Item {
|
||||
width: parent.width
|
||||
sourceComponent: dynamicThemeComponent
|
||||
}
|
||||
|
||||
Loader {
|
||||
width: parent.width
|
||||
sourceComponent: notificationOverlayComponent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,4 +884,69 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notification Overlay Component
|
||||
Component {
|
||||
id: notificationOverlayComponent
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: notificationOverlaySection.implicitHeight + Theme.spacingL * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
||||
Theme.surfaceVariant.b, 0.3)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.2)
|
||||
border.width: 1
|
||||
|
||||
Column {
|
||||
id: notificationOverlaySection
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingL
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
name: "notifications_active"
|
||||
size: Theme.iconSize
|
||||
color: Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.iconSize - Theme.spacingM - overlayToggle.width - Theme.spacingM
|
||||
spacing: Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StyledText {
|
||||
text: "Notification Overlay"
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Enable to display all notification priorities over fullscreen apps"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
id: overlayToggle
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.notificationOverlayEnabled
|
||||
onToggled: toggled => SettingsData.setNotificationOverlayEnabled(toggled)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user