diff options
Diffstat (limited to 'modules/background/Border.qml')
| -rw-r--r-- | modules/background/Border.qml | 116 |
1 files changed, 79 insertions, 37 deletions
diff --git a/modules/background/Border.qml b/modules/background/Border.qml index 752a814..a11c565 100644 --- a/modules/background/Border.qml +++ b/modules/background/Border.qml @@ -4,54 +4,96 @@ import Quickshell import QtQuick import QtQuick.Effects -StyledWindow { - id: win +Scope { + id: root - name: "border" - exclusionMode: ExclusionMode.Ignore + required property ShellScreen screen - 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 - } + StyledWindow { + id: win - anchors.top: true - anchors.bottom: true - anchors.left: true - anchors.right: true + screen: root.screen + name: "border" + exclusionMode: ExclusionMode.Ignore - StyledRect { - id: rect + 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.fill: parent - color: Appearance.alpha(Appearance.colours.m3surface, false) - visible: false - } + anchors.top: true + anchors.bottom: true + anchors.left: true + anchors.right: true - Item { - id: mask + 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 + } + } - anchors.fill: parent - layer.enabled: true - visible: false + MultiEffect { + id: effect - Rectangle { + visible: false anchors.fill: parent - anchors.margins: BackgroundConfig.border.thickness - radius: BackgroundConfig.border.rounding + maskEnabled: true + maskInverted: true + maskSource: mask + source: rect + maskThresholdMin: 0.5 + maskSpreadAtMin: 1 } + + LayerShadow { + source: effect + } + } + + ExclusionZone { + anchors.left: false + } + + ExclusionZone { + anchors.top: false } - MultiEffect { - anchors.fill: parent - maskEnabled: true - maskInverted: true - maskSource: mask - source: rect - maskThresholdMin: 0.5 - maskSpreadAtMin: 1 + ExclusionZone { + anchors.right: false + } + + ExclusionZone { + anchors.bottom: false + } + + component ExclusionZone: StyledWindow { + screen: root.screen + name: "border-exclusion" + width: BackgroundConfig.border.thickness + height: BackgroundConfig.border.thickness + + anchors.top: true + anchors.left: true + anchors.bottom: true + anchors.right: true } } |