mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-09 22:12:07 -04:00
fix(Settings): Restore Darken Modal Background ops in Standalone mode
This commit is contained in:
@@ -53,7 +53,7 @@ Item {
|
||||
readonly property alias contentWindow: contentWindow
|
||||
readonly property alias clickCatcher: clickCatcher
|
||||
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
||||
readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground
|
||||
readonly property bool useBackground: showBackground && !SettingsData.frameEnabled && SettingsData.modalDarkenBackground
|
||||
readonly property bool useSingleWindow: CompositorService.isHyprland || useBackground
|
||||
|
||||
signal opened
|
||||
|
||||
@@ -78,6 +78,7 @@ Item {
|
||||
readonly property real windowHeight: alignedHeight + contentY + shadowPad
|
||||
|
||||
readonly property color backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
readonly property bool useBackgroundDarken: !SettingsData.frameEnabled && SettingsData.modalDarkenBackground
|
||||
readonly property real cornerRadius: Theme.cornerRadius
|
||||
readonly property color borderColor: {
|
||||
if (!SettingsData.dankLauncherV2BorderEnabled)
|
||||
@@ -295,9 +296,9 @@ Item {
|
||||
PanelWindow {
|
||||
id: clickCatcher
|
||||
screen: launcherWindow.screen
|
||||
visible: spotlightOpen
|
||||
visible: spotlightOpen || isClosing
|
||||
color: "transparent"
|
||||
updatesEnabled: false
|
||||
updatesEnabled: root.useBackgroundDarken && (spotlightOpen || isClosing)
|
||||
|
||||
WlrLayershell.namespace: "dms:spotlight:clickcatcher"
|
||||
WlrLayershell.layer: WlrLayershell.Top
|
||||
@@ -330,10 +331,10 @@ Item {
|
||||
id: outsideClickHole
|
||||
visible: false
|
||||
color: "transparent"
|
||||
x: root.alignedX
|
||||
y: root.alignedY
|
||||
width: root.alignedWidth
|
||||
height: root.alignedHeight
|
||||
x: root.windowX
|
||||
y: root.windowY
|
||||
width: root.windowWidth
|
||||
height: root.windowHeight
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -341,6 +342,22 @@ Item {
|
||||
enabled: spotlightOpen
|
||||
onClicked: root.hide()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: backgroundDarken
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
opacity: contentVisible && root.useBackgroundDarken ? 0.5 : 0
|
||||
visible: (spotlightOpen || isClosing) && (root.useBackgroundDarken || opacity > 0)
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
easing.type: Easing.BezierSpline
|
||||
duration: Theme.modalAnimationDuration
|
||||
easing.bezierCurve: contentVisible ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PanelWindow {
|
||||
@@ -361,6 +378,8 @@ Item {
|
||||
|
||||
WlrLayershell.namespace: "dms:spotlight"
|
||||
WlrLayershell.layer: {
|
||||
if (root.useBackgroundDarken)
|
||||
return WlrLayershell.Overlay;
|
||||
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
||||
case "bottom":
|
||||
log.error("'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
|
||||
|
||||
Reference in New Issue
Block a user