From c665c0ca98d72c172893e8bbd9c893aaa2b9f46e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 5 May 2025 10:19:46 +1000 Subject: feat: border + colour changes --- modules/background/Background.qml | 34 +++++++++++++++++++++++ modules/background/Border.qml | 57 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 modules/background/Background.qml create mode 100644 modules/background/Border.qml (limited to 'modules/background') 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 + } +} -- cgit v1.2.3-freya