diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index a8a134e9..271bc12d 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -249,8 +249,6 @@ Singleton { onFrameModeChanged: saveSettings() property var connectedFrameBarStyleBackups: ({}) onConnectedFrameBarStyleBackupsChanged: saveSettings() - property var connectedFrameModalDarkenBackup: null - onConnectedFrameModalDarkenBackupChanged: saveSettings() readonly property bool connectedFrameModeActive: frameEnabled && frameMode === "connected" onConnectedFrameModeActiveChanged: { if (_loading) @@ -1610,10 +1608,6 @@ Singleton { function _reconcileConnectedFrameBarStyles() { if (!connectedFrameModeActive) { _restoreConnectedFrameBarStyleBackups(); - if (connectedFrameModalDarkenBackup === true) { - connectedFrameModalDarkenBackup = null; - set("modalDarkenBackground", true); - } return; } if (!_hasConnectedFrameBarStyleBackups()) @@ -1623,11 +1617,6 @@ Singleton { barConfigs = result.configs; updateBarConfigs(); } - // Force modalDarkenBackground off; capture backup if not already set - if (modalDarkenBackground) { - connectedFrameModalDarkenBackup = true; - set("modalDarkenBackground", false); - } } function detectAvailableIconThemes() { diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index ea6f5616..2ec3db82 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -447,7 +447,6 @@ var SPEC = { displayShowDisconnected: { def: false }, displaySnapToEdge: { def: true }, connectedFrameBarStyleBackups: { def: {} }, - connectedFrameModalDarkenBackup: { def: null }, barConfigs: { def: [{ diff --git a/quickshell/Modals/Common/DankModalStandalone.qml b/quickshell/Modals/Common/DankModalStandalone.qml index defeaab5..75efc8b4 100644 --- a/quickshell/Modals/Common/DankModalStandalone.qml +++ b/quickshell/Modals/Common/DankModalStandalone.qml @@ -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 diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml index a352cb35..9355d5a4 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml @@ -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."); diff --git a/quickshell/Modules/Settings/ThemeColorsTab.qml b/quickshell/Modules/Settings/ThemeColorsTab.qml index be78b134..6888a332 100644 --- a/quickshell/Modules/Settings/ThemeColorsTab.qml +++ b/quickshell/Modules/Settings/ThemeColorsTab.qml @@ -13,6 +13,7 @@ Item { property var parentModal: null readonly property bool connectedFrameModeActive: SettingsData.connectedFrameModeActive + readonly property bool frameModeActive: SettingsData.frameEnabled property var cachedIconThemes: SettingsData.availableIconThemes property var cachedCursorThemes: SettingsData.availableCursorThemes property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label) @@ -2251,10 +2252,10 @@ Item { iconName: "layers" SettingsControlledByFrame { - visible: themeColorsTab.connectedFrameModeActive + visible: themeColorsTab.frameModeActive parentModal: themeColorsTab.parentModal settingLabel: I18n.tr("Darken Modal Background") - reason: I18n.tr("Managed by Frame in Connected Mode") + reason: I18n.tr("Disabled by Frame Mode") } SettingsToggleRow { @@ -2263,7 +2264,7 @@ Item { settingKey: "modalDarkenBackground" text: I18n.tr("Darken Modal Background") description: I18n.tr("Show darkened overlay behind modal dialogs") - visible: !themeColorsTab.connectedFrameModeActive + visible: !themeColorsTab.frameModeActive checked: SettingsData.modalDarkenBackground onToggled: checked => SettingsData.set("modalDarkenBackground", checked) }