summaryrefslogtreecommitdiff
path: root/modules/drawers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/drawers')
-rw-r--r--modules/drawers/Drawers.qml18
-rw-r--r--modules/drawers/Interactions.qml15
-rw-r--r--modules/drawers/Panels.qml5
3 files changed, 30 insertions, 8 deletions
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index d8f242b..937409a 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -70,14 +70,24 @@ Variants {
source: background
}
- Panels {
- id: panels
+ PersistentProperties {
+ id: visibilities
- screen: scope.modelData
+ property bool launcher
+ property bool osd
+ property bool notifs
+ property bool session
}
Interactions {
- screen: scope.modelData
+ visibilities: visibilities
+
+ Panels {
+ id: panels
+
+ screen: scope.modelData
+ visibilities: visibilities
+ }
}
}
}
diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml
index 5006a96..aab23aa 100644
--- a/modules/drawers/Interactions.qml
+++ b/modules/drawers/Interactions.qml
@@ -1,11 +1,22 @@
import "root:/services"
+import "root:/config"
import Quickshell
import QtQuick
MouseArea {
- required property ShellScreen screen
+ required property PersistentProperties visibilities
+
+ property point dragStart
anchors.fill: parent
hoverEnabled: true
- onPositionChanged: event => Drawers.setPosForScreen(screen, event.x, event.y)
+
+ onPressed: event => dragStart = Qt.point(event.x, event.y)
+ onExited: visibilities.osd = false
+
+ onPositionChanged: ({x, y}) => {
+ // Show osd on hover
+ const osd = panels.osd;
+ visibilities.osd = (x > width - BorderConfig.thickness - osd.width && y >= osd.y && y <= osd.y + osd.height);
+ }
}
diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml
index fd56f1b..06b4a09 100644
--- a/modules/drawers/Panels.qml
+++ b/modules/drawers/Panels.qml
@@ -1,5 +1,3 @@
-import "root:/widgets"
-import "root:/services"
import "root:/config"
import "root:/modules/osd" as Osd
import Quickshell
@@ -9,6 +7,8 @@ Item {
id: root
required property ShellScreen screen
+ required property PersistentProperties visibilities
+
readonly property Osd.Wrapper osd: osd
anchors.fill: parent
@@ -18,6 +18,7 @@ Item {
id: osd
screen: root.screen
+ visibility: visibilities.osd
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right