mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-14 16:22:46 -04:00
fix(Settings): Restore Darken Modal Background ops in Standalone mode
This commit is contained in:
@@ -249,8 +249,6 @@ Singleton {
|
|||||||
onFrameModeChanged: saveSettings()
|
onFrameModeChanged: saveSettings()
|
||||||
property var connectedFrameBarStyleBackups: ({})
|
property var connectedFrameBarStyleBackups: ({})
|
||||||
onConnectedFrameBarStyleBackupsChanged: saveSettings()
|
onConnectedFrameBarStyleBackupsChanged: saveSettings()
|
||||||
property var connectedFrameModalDarkenBackup: null
|
|
||||||
onConnectedFrameModalDarkenBackupChanged: saveSettings()
|
|
||||||
readonly property bool connectedFrameModeActive: frameEnabled && frameMode === "connected"
|
readonly property bool connectedFrameModeActive: frameEnabled && frameMode === "connected"
|
||||||
onConnectedFrameModeActiveChanged: {
|
onConnectedFrameModeActiveChanged: {
|
||||||
if (_loading)
|
if (_loading)
|
||||||
@@ -1610,10 +1608,6 @@ Singleton {
|
|||||||
function _reconcileConnectedFrameBarStyles() {
|
function _reconcileConnectedFrameBarStyles() {
|
||||||
if (!connectedFrameModeActive) {
|
if (!connectedFrameModeActive) {
|
||||||
_restoreConnectedFrameBarStyleBackups();
|
_restoreConnectedFrameBarStyleBackups();
|
||||||
if (connectedFrameModalDarkenBackup === true) {
|
|
||||||
connectedFrameModalDarkenBackup = null;
|
|
||||||
set("modalDarkenBackground", true);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!_hasConnectedFrameBarStyleBackups())
|
if (!_hasConnectedFrameBarStyleBackups())
|
||||||
@@ -1623,11 +1617,6 @@ Singleton {
|
|||||||
barConfigs = result.configs;
|
barConfigs = result.configs;
|
||||||
updateBarConfigs();
|
updateBarConfigs();
|
||||||
}
|
}
|
||||||
// Force modalDarkenBackground off; capture backup if not already set
|
|
||||||
if (modalDarkenBackground) {
|
|
||||||
connectedFrameModalDarkenBackup = true;
|
|
||||||
set("modalDarkenBackground", false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectAvailableIconThemes() {
|
function detectAvailableIconThemes() {
|
||||||
|
|||||||
@@ -447,7 +447,6 @@ var SPEC = {
|
|||||||
displayShowDisconnected: { def: false },
|
displayShowDisconnected: { def: false },
|
||||||
displaySnapToEdge: { def: true },
|
displaySnapToEdge: { def: true },
|
||||||
connectedFrameBarStyleBackups: { def: {} },
|
connectedFrameBarStyleBackups: { def: {} },
|
||||||
connectedFrameModalDarkenBackup: { def: null },
|
|
||||||
|
|
||||||
barConfigs: {
|
barConfigs: {
|
||||||
def: [{
|
def: [{
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Item {
|
|||||||
readonly property alias contentWindow: contentWindow
|
readonly property alias contentWindow: contentWindow
|
||||||
readonly property alias clickCatcher: clickCatcher
|
readonly property alias clickCatcher: clickCatcher
|
||||||
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
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
|
readonly property bool useSingleWindow: CompositorService.isHyprland || useBackground
|
||||||
|
|
||||||
signal opened
|
signal opened
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ Item {
|
|||||||
readonly property real windowHeight: alignedHeight + contentY + shadowPad
|
readonly property real windowHeight: alignedHeight + contentY + shadowPad
|
||||||
|
|
||||||
readonly property color backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
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 real cornerRadius: Theme.cornerRadius
|
||||||
readonly property color borderColor: {
|
readonly property color borderColor: {
|
||||||
if (!SettingsData.dankLauncherV2BorderEnabled)
|
if (!SettingsData.dankLauncherV2BorderEnabled)
|
||||||
@@ -295,9 +296,9 @@ Item {
|
|||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: clickCatcher
|
id: clickCatcher
|
||||||
screen: launcherWindow.screen
|
screen: launcherWindow.screen
|
||||||
visible: spotlightOpen
|
visible: spotlightOpen || isClosing
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
updatesEnabled: false
|
updatesEnabled: root.useBackgroundDarken && (spotlightOpen || isClosing)
|
||||||
|
|
||||||
WlrLayershell.namespace: "dms:spotlight:clickcatcher"
|
WlrLayershell.namespace: "dms:spotlight:clickcatcher"
|
||||||
WlrLayershell.layer: WlrLayershell.Top
|
WlrLayershell.layer: WlrLayershell.Top
|
||||||
@@ -330,10 +331,10 @@ Item {
|
|||||||
id: outsideClickHole
|
id: outsideClickHole
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
x: root.alignedX
|
x: root.windowX
|
||||||
y: root.alignedY
|
y: root.windowY
|
||||||
width: root.alignedWidth
|
width: root.windowWidth
|
||||||
height: root.alignedHeight
|
height: root.windowHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -341,6 +342,22 @@ Item {
|
|||||||
enabled: spotlightOpen
|
enabled: spotlightOpen
|
||||||
onClicked: root.hide()
|
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 {
|
PanelWindow {
|
||||||
@@ -361,6 +378,8 @@ Item {
|
|||||||
|
|
||||||
WlrLayershell.namespace: "dms:spotlight"
|
WlrLayershell.namespace: "dms:spotlight"
|
||||||
WlrLayershell.layer: {
|
WlrLayershell.layer: {
|
||||||
|
if (root.useBackgroundDarken)
|
||||||
|
return WlrLayershell.Overlay;
|
||||||
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
||||||
case "bottom":
|
case "bottom":
|
||||||
log.error("'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
|
log.error("'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Item {
|
|||||||
|
|
||||||
property var parentModal: null
|
property var parentModal: null
|
||||||
readonly property bool connectedFrameModeActive: SettingsData.connectedFrameModeActive
|
readonly property bool connectedFrameModeActive: SettingsData.connectedFrameModeActive
|
||||||
|
readonly property bool frameModeActive: SettingsData.frameEnabled
|
||||||
property var cachedIconThemes: SettingsData.availableIconThemes
|
property var cachedIconThemes: SettingsData.availableIconThemes
|
||||||
property var cachedCursorThemes: SettingsData.availableCursorThemes
|
property var cachedCursorThemes: SettingsData.availableCursorThemes
|
||||||
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
|
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
|
||||||
@@ -2251,10 +2252,10 @@ Item {
|
|||||||
iconName: "layers"
|
iconName: "layers"
|
||||||
|
|
||||||
SettingsControlledByFrame {
|
SettingsControlledByFrame {
|
||||||
visible: themeColorsTab.connectedFrameModeActive
|
visible: themeColorsTab.frameModeActive
|
||||||
parentModal: themeColorsTab.parentModal
|
parentModal: themeColorsTab.parentModal
|
||||||
settingLabel: I18n.tr("Darken Modal Background")
|
settingLabel: I18n.tr("Darken Modal Background")
|
||||||
reason: I18n.tr("Managed by Frame in Connected Mode")
|
reason: I18n.tr("Disabled by Frame Mode")
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
@@ -2263,7 +2264,7 @@ Item {
|
|||||||
settingKey: "modalDarkenBackground"
|
settingKey: "modalDarkenBackground"
|
||||||
text: I18n.tr("Darken Modal Background")
|
text: I18n.tr("Darken Modal Background")
|
||||||
description: I18n.tr("Show darkened overlay behind modal dialogs")
|
description: I18n.tr("Show darkened overlay behind modal dialogs")
|
||||||
visible: !themeColorsTab.connectedFrameModeActive
|
visible: !themeColorsTab.frameModeActive
|
||||||
checked: SettingsData.modalDarkenBackground
|
checked: SettingsData.modalDarkenBackground
|
||||||
onToggled: checked => SettingsData.set("modalDarkenBackground", checked)
|
onToggled: checked => SettingsData.set("modalDarkenBackground", checked)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user