mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
modals: restore Top layer as default
- Cut a mask in the background window - restores virt kb compat
This commit is contained in:
@@ -49,10 +49,7 @@ Item {
|
|||||||
signal dialogClosed
|
signal dialogClosed
|
||||||
signal backgroundClicked
|
signal backgroundClicked
|
||||||
|
|
||||||
readonly property bool useBackgroundWindow: {
|
readonly property bool useBackgroundWindow: true
|
||||||
const layerOverride = Quickshell.env("DMS_MODAL_LAYER");
|
|
||||||
return !layerOverride || layerOverride === "overlay";
|
|
||||||
}
|
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
ModalManager.openModal(root);
|
ModalManager.openModal(root);
|
||||||
@@ -146,6 +143,16 @@ Item {
|
|||||||
bottom: true
|
bottom: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mask: Region {
|
||||||
|
item: Rectangle {
|
||||||
|
x: root.alignedX
|
||||||
|
y: root.alignedY
|
||||||
|
width: root.shouldBeVisible ? root.alignedWidth : 0
|
||||||
|
height: root.shouldBeVisible ? root.alignedHeight : 0
|
||||||
|
}
|
||||||
|
intersection: Intersection.Xor
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: root.closeOnBackgroundClick && root.shouldBeVisible
|
enabled: root.closeOnBackgroundClick && root.shouldBeVisible
|
||||||
@@ -186,13 +193,15 @@ Item {
|
|||||||
WlrLayershell.layer: {
|
WlrLayershell.layer: {
|
||||||
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
||||||
case "bottom":
|
case "bottom":
|
||||||
return WlrLayershell.Bottom;
|
console.error("DankModal: 'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
|
||||||
case "top":
|
|
||||||
return WlrLayershell.Top;
|
return WlrLayershell.Top;
|
||||||
case "background":
|
case "background":
|
||||||
return WlrLayershell.Background;
|
console.error("DankModal: 'background' layer is not valid for modals. Defaulting to 'top' layer.");
|
||||||
default:
|
return WlrLayershell.Top;
|
||||||
|
case "overlay":
|
||||||
return WlrLayershell.Overlay;
|
return WlrLayershell.Overlay;
|
||||||
|
default:
|
||||||
|
return WlrLayershell.Top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
|
|||||||
@@ -91,10 +91,7 @@ Item {
|
|||||||
setBarContext(pos, bottomGap);
|
setBarContext(pos, bottomGap);
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool useBackgroundWindow: {
|
readonly property bool useBackgroundWindow: true
|
||||||
const layerOverride = Quickshell.env("DMS_POPOUT_LAYER");
|
|
||||||
return !layerOverride || layerOverride === "overlay";
|
|
||||||
}
|
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
if (!screen)
|
if (!screen)
|
||||||
@@ -258,13 +255,15 @@ Item {
|
|||||||
WlrLayershell.layer: {
|
WlrLayershell.layer: {
|
||||||
switch (Quickshell.env("DMS_POPOUT_LAYER")) {
|
switch (Quickshell.env("DMS_POPOUT_LAYER")) {
|
||||||
case "bottom":
|
case "bottom":
|
||||||
return WlrLayershell.Bottom;
|
console.warn("DankPopout: 'bottom' layer is not valid for popouts. Defaulting to 'top' layer.");
|
||||||
case "top":
|
|
||||||
return WlrLayershell.Top;
|
return WlrLayershell.Top;
|
||||||
case "background":
|
case "background":
|
||||||
return WlrLayershell.Background;
|
console.warn("DankPopout: 'background' layer is not valid for popouts. Defaulting to 'top' layer.");
|
||||||
default:
|
return WlrLayershell.Top;
|
||||||
|
case "overlay":
|
||||||
return WlrLayershell.Overlay;
|
return WlrLayershell.Overlay;
|
||||||
|
default:
|
||||||
|
return WlrLayershell.Top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
|
|||||||
Reference in New Issue
Block a user