mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 04:42:05 -04:00
(frame): Multi-monitor support
This commit is contained in:
@@ -7,10 +7,10 @@ import qs.Common
|
||||
Variants {
|
||||
id: root
|
||||
|
||||
model: SettingsData.getFrameScreensAlways()
|
||||
model: Quickshell.screens
|
||||
|
||||
FrameInstance {
|
||||
required property ShellScreen modelData
|
||||
required property var modelData
|
||||
|
||||
screen: modelData
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import qs.Common
|
||||
Scope {
|
||||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
required property var screen
|
||||
|
||||
readonly property var barEdges: {
|
||||
SettingsData.barConfigs; // force re-eval when bar configs change
|
||||
@@ -18,10 +18,12 @@ Scope {
|
||||
// One thin invisible PanelWindow per edge.
|
||||
// Skips any edge where a bar already provides its own exclusiveZone.
|
||||
|
||||
readonly property bool screenEnabled: SettingsData.frameEnabled && SettingsData.isScreenInPreferences(root.screen, SettingsData.frameScreenPreferences)
|
||||
|
||||
Loader {
|
||||
active: SettingsData.frameEnabled && !root.barEdges.includes("top")
|
||||
active: root.screenEnabled && !root.barEdges.includes("top")
|
||||
sourceComponent: EdgeExclusion {
|
||||
screen: root.screen
|
||||
targetScreen: root.screen
|
||||
anchorTop: true
|
||||
anchorLeft: true
|
||||
anchorRight: true
|
||||
@@ -29,9 +31,9 @@ Scope {
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: SettingsData.frameEnabled && !root.barEdges.includes("bottom")
|
||||
active: root.screenEnabled && !root.barEdges.includes("bottom")
|
||||
sourceComponent: EdgeExclusion {
|
||||
screen: root.screen
|
||||
targetScreen: root.screen
|
||||
anchorBottom: true
|
||||
anchorLeft: true
|
||||
anchorRight: true
|
||||
@@ -39,9 +41,9 @@ Scope {
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: SettingsData.frameEnabled && !root.barEdges.includes("left")
|
||||
active: root.screenEnabled && !root.barEdges.includes("left")
|
||||
sourceComponent: EdgeExclusion {
|
||||
screen: root.screen
|
||||
targetScreen: root.screen
|
||||
anchorLeft: true
|
||||
anchorTop: true
|
||||
anchorBottom: true
|
||||
@@ -49,9 +51,9 @@ Scope {
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: SettingsData.frameEnabled && !root.barEdges.includes("right")
|
||||
active: root.screenEnabled && !root.barEdges.includes("right")
|
||||
sourceComponent: EdgeExclusion {
|
||||
screen: root.screen
|
||||
targetScreen: root.screen
|
||||
anchorRight: true
|
||||
anchorTop: true
|
||||
anchorBottom: true
|
||||
@@ -59,7 +61,9 @@ Scope {
|
||||
}
|
||||
|
||||
component EdgeExclusion: PanelWindow {
|
||||
required property ShellScreen screen
|
||||
required property var targetScreen
|
||||
|
||||
screen: targetScreen
|
||||
property bool anchorTop: false
|
||||
property bool anchorBottom: false
|
||||
property bool anchorLeft: false
|
||||
|
||||
@@ -6,10 +6,10 @@ import Quickshell
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
required property var screen
|
||||
|
||||
FrameWindow {
|
||||
screen: root.screen
|
||||
targetScreen: root.screen
|
||||
}
|
||||
|
||||
FrameExclusions {
|
||||
|
||||
@@ -8,7 +8,10 @@ import qs.Common
|
||||
PanelWindow {
|
||||
id: win
|
||||
|
||||
required property ShellScreen screen
|
||||
required property var targetScreen
|
||||
|
||||
screen: targetScreen
|
||||
visible: true
|
||||
|
||||
WlrLayershell.namespace: "dms:frame"
|
||||
WlrLayershell.layer: WlrLayer.Top
|
||||
@@ -28,7 +31,7 @@ PanelWindow {
|
||||
|
||||
FrameBorder {
|
||||
anchors.fill: parent
|
||||
visible: SettingsData.frameEnabled
|
||||
visible: SettingsData.frameEnabled && SettingsData.isScreenInPreferences(win.screen, SettingsData.frameScreenPreferences)
|
||||
barEdges: { SettingsData.barConfigs; return SettingsData.getActiveBarEdgesForScreen(win.screen); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ Item {
|
||||
description: modelData.width + "×" + modelData.height
|
||||
checked: localChecked
|
||||
onToggled: isChecked => {
|
||||
localChecked = isChecked;
|
||||
var prefs = JSON.parse(JSON.stringify(root.displayPreferences));
|
||||
if (!Array.isArray(prefs) || prefs.includes("all"))
|
||||
prefs = [];
|
||||
@@ -94,6 +93,11 @@ Item {
|
||||
model: modelData.model || ""
|
||||
});
|
||||
}
|
||||
if (prefs.length === 0) {
|
||||
localChecked = true;
|
||||
return;
|
||||
}
|
||||
localChecked = isChecked;
|
||||
root.preferencesChanged(prefs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user