1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-08 14:52:08 -04:00

Initial framework

This commit is contained in:
purian23
2026-03-22 23:26:04 -04:00
parent 32c063aab8
commit ce12eba0d8
14 changed files with 540 additions and 32 deletions

View File

@@ -0,0 +1,17 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import qs.Common
Variants {
id: root
model: SettingsData.frameEnabled ? SettingsData.getFrameFilteredScreens() : []
FrameInstance {
required property ShellScreen modelData
screen: modelData
}
}

View File

@@ -0,0 +1,53 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Effects
import qs.Common
Item {
id: root
required property string barEdge // "top" | "bottom" | "left" | "right" | ""
required property real barThickness
anchors.fill: parent
readonly property real _thickness: SettingsData.frameThickness
readonly property real _rounding: SettingsData.frameRounding
Rectangle {
id: borderRect
anchors.fill: parent
color: SettingsData.frameColor
opacity: SettingsData.frameOpacity
layer.enabled: true
layer.effect: MultiEffect {
maskSource: cutoutMask
maskEnabled: true
maskInverted: true
maskThresholdMin: 0.5
maskSpreadAtMin: 1
}
}
Item {
id: cutoutMask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors {
fill: parent
topMargin: root.barEdge === "top" ? root.barThickness : root._thickness
bottomMargin: root.barEdge === "bottom" ? root.barThickness : root._thickness
leftMargin: root.barEdge === "left" ? root.barThickness : root._thickness
rightMargin: root.barEdge === "right" ? root.barThickness : root._thickness
}
radius: root._rounding
}
}
}

View File

@@ -0,0 +1,80 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.Common
Scope {
id: root
required property ShellScreen screen
readonly property string barEdge: SettingsData.getActiveBarEdgeForScreen(screen)
// One thin invisible PanelWindow per edge.
// Skips the edge where the bar already provides its own exclusiveZone.
Loader {
active: root.barEdge !== "top"
sourceComponent: EdgeExclusion {
screen: root.screen
anchorTop: true
anchorLeft: true
anchorRight: true
}
}
Loader {
active: root.barEdge !== "bottom"
sourceComponent: EdgeExclusion {
screen: root.screen
anchorBottom: true
anchorLeft: true
anchorRight: true
}
}
Loader {
active: root.barEdge !== "left"
sourceComponent: EdgeExclusion {
screen: root.screen
anchorLeft: true
anchorTop: true
anchorBottom: true
}
}
Loader {
active: root.barEdge !== "right"
sourceComponent: EdgeExclusion {
screen: root.screen
anchorRight: true
anchorTop: true
anchorBottom: true
}
}
component EdgeExclusion: PanelWindow {
required property ShellScreen screen
property bool anchorTop: false
property bool anchorBottom: false
property bool anchorLeft: false
property bool anchorRight: false
WlrLayershell.namespace: "dms:frame-exclusion"
WlrLayershell.layer: WlrLayer.Top
exclusiveZone: SettingsData.frameThickness
color: "transparent"
mask: Region {}
implicitWidth: 1
implicitHeight: 1
anchors {
top: anchorTop
bottom: anchorBottom
left: anchorLeft
right: anchorRight
}
}
}

View File

@@ -0,0 +1,18 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
Item {
id: root
required property ShellScreen screen
FrameWindow {
screen: root.screen
}
FrameExclusions {
screen: root.screen
}
}

View File

@@ -0,0 +1,34 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.Common
PanelWindow {
id: win
required property ShellScreen screen
WlrLayershell.namespace: "dms:frame"
WlrLayershell.layer: WlrLayer.Bottom
WlrLayershell.exclusionMode: ExclusionMode.Ignore
anchors {
top: true
bottom: true
left: true
right: true
}
color: "transparent"
// No input — pass everything through to apps and bar
mask: Region {}
FrameBorder {
anchors.fill: parent
barEdge: SettingsData.getActiveBarEdgeForScreen(win.screen)
barThickness: SettingsData.getActiveBarThicknessForScreen(win.screen)
}
}