summaryrefslogtreecommitdiff
path: root/modules/drawers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/drawers')
-rw-r--r--modules/drawers/Border.qml52
-rw-r--r--modules/drawers/Drawers.qml49
-rw-r--r--modules/drawers/Exclusions.qml39
3 files changed, 140 insertions, 0 deletions
diff --git a/modules/drawers/Border.qml b/modules/drawers/Border.qml
new file mode 100644
index 0000000..124f73f
--- /dev/null
+++ b/modules/drawers/Border.qml
@@ -0,0 +1,52 @@
+import "root:/widgets"
+import "root:/services"
+import "root:/config"
+import Quickshell
+import QtQuick
+import QtQuick.Effects
+
+Item {
+ id: root
+
+ required property ShellScreen screen
+
+ anchors.fill: parent
+
+ StyledRect {
+ id: rect
+
+ anchors.fill: parent
+ color: Colours.alpha(BorderConfig.colour, false)
+ visible: false
+ }
+
+ Item {
+ id: mask
+
+ anchors.fill: parent
+ layer.enabled: true
+ visible: false
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: BorderConfig.thickness
+ radius: BorderConfig.rounding
+ }
+ }
+
+ MultiEffect {
+ anchors.fill: parent
+ maskEnabled: true
+ maskInverted: true
+ maskSource: mask
+ source: rect
+ maskThresholdMin: 0.5
+ maskSpreadAtMin: 1
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onPositionChanged: event => Drawers.setPosForScreen(root.screen, event.x, event.y)
+ }
+}
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
new file mode 100644
index 0000000..30fcae0
--- /dev/null
+++ b/modules/drawers/Drawers.qml
@@ -0,0 +1,49 @@
+import "root:/widgets"
+import "root:/config"
+import Quickshell
+
+Variants {
+ model: Quickshell.screens
+
+ Scope {
+ id: scope
+
+ required property ShellScreen modelData
+
+ Exclusions {
+ screen: scope.modelData
+ }
+
+ StyledWindow {
+ id: win
+
+ screen: scope.modelData
+ name: "drawers"
+ exclusionMode: ExclusionMode.Ignore
+
+ mask: Region {
+ x: BorderConfig.thickness
+ y: BorderConfig.thickness
+ width: scope.modelData.width - BorderConfig.thickness * 2
+ height: scope.modelData.height - BorderConfig.thickness * 2
+ intersection: Intersection.Xor
+ }
+
+ anchors.top: true
+ anchors.bottom: true
+ anchors.left: true
+ anchors.right: true
+
+ Border {
+ id: border
+
+ visible: false
+ screen: scope.modelData
+ }
+
+ LayerShadow {
+ source: border
+ }
+ }
+ }
+}
diff --git a/modules/drawers/Exclusions.qml b/modules/drawers/Exclusions.qml
new file mode 100644
index 0000000..c8b3959
--- /dev/null
+++ b/modules/drawers/Exclusions.qml
@@ -0,0 +1,39 @@
+pragma ComponentBehavior: Bound
+
+import "root:/widgets"
+import "root:/config"
+import Quickshell
+
+Scope {
+ id: root
+
+ required property ShellScreen screen
+
+ ExclusionZone {
+ anchors.left: false
+ }
+
+ ExclusionZone {
+ anchors.top: false
+ }
+
+ ExclusionZone {
+ anchors.right: false
+ }
+
+ ExclusionZone {
+ anchors.bottom: false
+ }
+
+ component ExclusionZone: StyledWindow {
+ screen: root.screen
+ name: "border-exclusion"
+ width: BorderConfig.thickness
+ height: BorderConfig.thickness
+
+ anchors.top: true
+ anchors.left: true
+ anchors.bottom: true
+ anchors.right: true
+ }
+}