summaryrefslogtreecommitdiff
path: root/modules/drawers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/drawers')
-rw-r--r--modules/drawers/Backgrounds.qml3
-rw-r--r--modules/drawers/Border.qml3
-rw-r--r--modules/drawers/Drawers.qml23
-rw-r--r--modules/drawers/Exclusions.qml3
-rw-r--r--modules/drawers/Interactions.qml11
-rw-r--r--modules/drawers/Panels.qml2
6 files changed, 34 insertions, 11 deletions
diff --git a/modules/drawers/Backgrounds.qml b/modules/drawers/Backgrounds.qml
index df8d2eb..2b08b7b 100644
--- a/modules/drawers/Backgrounds.qml
+++ b/modules/drawers/Backgrounds.qml
@@ -6,15 +6,18 @@ import "root:/modules/session" as Session
import "root:/modules/launcher" as Launcher
import "root:/modules/dashboard" as Dashboard
import "root:/modules/bar/popouts" as BarPopouts
+import QtQuick
import QtQuick.Shapes
Shape {
id: root
required property Panels panels
+ required property Item bar
anchors.fill: parent
anchors.margins: BorderConfig.thickness
+ anchors.leftMargin: bar.implicitWidth
preferredRendererType: Shape.CurveRenderer
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
diff --git a/modules/drawers/Border.qml b/modules/drawers/Border.qml
index 64fd7f9..9014d07 100644
--- a/modules/drawers/Border.qml
+++ b/modules/drawers/Border.qml
@@ -8,6 +8,8 @@ import QtQuick.Effects
Item {
id: root
+ required property Item bar
+
anchors.fill: parent
StyledRect {
@@ -28,6 +30,7 @@ Item {
Rectangle {
anchors.fill: parent
anchors.margins: BorderConfig.thickness
+ anchors.leftMargin: root.bar.implicitWidth
radius: BorderConfig.rounding
}
}
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 3aabc48..c897f4a 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
+import "root:/modules/bar"
import Quickshell
import Quickshell.Wayland
import Quickshell.Hyprland
@@ -18,6 +19,7 @@ Variants {
Exclusions {
screen: scope.modelData
+ bar: bar
}
StyledWindow {
@@ -29,9 +31,9 @@ Variants {
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.session ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
mask: Region {
- x: BorderConfig.thickness
+ x: bar.implicitWidth
y: BorderConfig.thickness
- width: win.width - BorderConfig.thickness * 2
+ width: win.width - bar.implicitWidth - BorderConfig.thickness
height: win.height - BorderConfig.thickness * 2
intersection: Intersection.Xor
@@ -43,8 +45,6 @@ Variants {
anchors.left: true
anchors.right: true
- margins.left: Visibilities.bars[screen]?.implicitWidth ?? 0
-
Variants {
id: regions
@@ -53,7 +53,7 @@ Variants {
Region {
required property Item modelData
- x: modelData.x + BorderConfig.thickness
+ x: modelData.x + bar.implicitWidth
y: modelData.y + BorderConfig.thickness
width: modelData.width
height: modelData.height
@@ -90,10 +90,13 @@ Variants {
anchors.fill: parent
visible: false
- Border {}
+ Border {
+ bar: bar
+ }
Backgrounds {
panels: panels
+ bar: bar
}
}
@@ -116,14 +119,22 @@ Variants {
screen: scope.modelData
visibilities: visibilities
panels: panels
+ bar: bar
Panels {
id: panels
screen: scope.modelData
visibilities: visibilities
+ bar: bar
}
}
+
+ Bar {
+ id: bar
+
+ screen: scope.modelData
+ }
}
}
}
diff --git a/modules/drawers/Exclusions.qml b/modules/drawers/Exclusions.qml
index 8ad23a2..188aadb 100644
--- a/modules/drawers/Exclusions.qml
+++ b/modules/drawers/Exclusions.qml
@@ -3,14 +3,17 @@ pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/config"
import Quickshell
+import QtQuick
Scope {
id: root
required property ShellScreen screen
+ required property Item bar
ExclusionZone {
anchors.left: true
+ exclusiveZone: root.bar.implicitWidth
}
ExclusionZone {
diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml
index 42e423d..e66c24d 100644
--- a/modules/drawers/Interactions.qml
+++ b/modules/drawers/Interactions.qml
@@ -10,6 +10,7 @@ MouseArea {
required property ShellScreen screen
required property PersistentProperties visibilities
required property Panels panels
+ required property Item bar
property bool osdHovered
property point dragStart
@@ -20,11 +21,11 @@ MouseArea {
}
function inRightPanel(panel: Item, x: real, y: real): bool {
- return x > BorderConfig.thickness + panel.x && withinPanelHeight(panel, x, y);
+ return x > bar.implicitWidth + panel.x && withinPanelHeight(panel, x, y);
}
function inTopPanel(panel: Item, x: real, y: real): bool {
- const panelX = BorderConfig.thickness + panel.x;
+ const panelX = bar.implicitWidth + panel.x;
return y < BorderConfig.thickness + panel.y + panel.height && x >= panelX - BorderConfig.rounding && x <= panelX + panel.width + BorderConfig.rounding;
}
@@ -61,10 +62,10 @@ MouseArea {
// Show popouts on hover
const popout = panels.popouts;
- if (x < BorderConfig.thickness + popout.width) {
- if (x < BorderConfig.thickness)
+ if (x < bar.implicitWidth + popout.width) {
+ if (x < bar.implicitWidth)
// Handle like part of bar
- Visibilities.bars[screen].checkPopout(y);
+ bar.checkPopout(y);
else
// Keep on hover
Popouts.hasCurrent = withinPanelHeight(popout, x, y);
diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml
index b127031..0514b3e 100644
--- a/modules/drawers/Panels.qml
+++ b/modules/drawers/Panels.qml
@@ -14,6 +14,7 @@ Item {
required property ShellScreen screen
required property PersistentProperties visibilities
+ required property Item bar
readonly property Osd.Wrapper osd: osd
readonly property Notifications.Wrapper notifications: notifications
@@ -24,6 +25,7 @@ Item {
anchors.fill: parent
anchors.margins: BorderConfig.thickness
+ anchors.leftMargin: bar.implicitWidth
Component.onCompleted: Visibilities.panels[screen] = this