summaryrefslogtreecommitdiff
path: root/modules/background
diff options
context:
space:
mode:
Diffstat (limited to 'modules/background')
-rw-r--r--modules/background/Background.qml34
-rw-r--r--modules/background/Border.qml57
2 files changed, 91 insertions, 0 deletions
diff --git a/modules/background/Background.qml b/modules/background/Background.qml
new file mode 100644
index 0000000..edd7613
--- /dev/null
+++ b/modules/background/Background.qml
@@ -0,0 +1,34 @@
+import "root:/widgets"
+import "root:/config"
+import Quickshell
+import Quickshell.Wayland
+import QtQuick
+import QtQuick.Effects
+
+Variants {
+ model: Quickshell.screens
+
+ Scope {
+ id: scope
+
+ required property ShellScreen modelData
+
+ Border {
+ screen: scope.modelData
+ }
+
+ StyledWindow {
+ id: win
+
+ screen: scope.modelData
+ name: "background"
+ exclusionMode: ExclusionMode.Ignore
+ layer: WlrLayer.Background
+
+ anchors.top: true
+ anchors.bottom: true
+ anchors.left: true
+ anchors.right: true
+ }
+ }
+}
diff --git a/modules/background/Border.qml b/modules/background/Border.qml
new file mode 100644
index 0000000..752a814
--- /dev/null
+++ b/modules/background/Border.qml
@@ -0,0 +1,57 @@
+import "root:/widgets"
+import "root:/config"
+import Quickshell
+import QtQuick
+import QtQuick.Effects
+
+StyledWindow {
+ id: win
+
+ name: "border"
+ exclusionMode: ExclusionMode.Ignore
+
+ mask: Region {
+ x: BackgroundConfig.border.thickness
+ y: BackgroundConfig.border.thickness
+ width: win.screen.width - BackgroundConfig.border.thickness * 2
+ height: win.screen.height - BackgroundConfig.border.thickness * 2
+ intersection: Intersection.Xor
+ }
+
+ anchors.top: true
+ anchors.bottom: true
+ anchors.left: true
+ anchors.right: true
+
+ StyledRect {
+ id: rect
+
+ anchors.fill: parent
+ color: Appearance.alpha(Appearance.colours.m3surface, false)
+ visible: false
+ }
+
+ Item {
+ id: mask
+
+ anchors.fill: parent
+ layer.enabled: true
+ visible: false
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: BackgroundConfig.border.thickness
+ radius: BackgroundConfig.border.rounding
+ }
+ }
+
+ MultiEffect {
+ anchors.fill: parent
+ maskEnabled: true
+ maskInverted: true
+ maskSource: mask
+ source: rect
+ maskThresholdMin: 0.5
+ maskSpreadAtMin: 1
+ }
+}