summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-05 20:21:56 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-05 20:21:56 +1000
commit137fd56bb28aafb6973194208e2b0346367a10fe (patch)
tree77475aca38b9a60d014cd6b734c9a8fc1db76355
parentlauncher: focus actual current wall (diff)
downloadcaelestia-shell-137fd56bb28aafb6973194208e2b0346367a10fe.tar.gz
caelestia-shell-137fd56bb28aafb6973194208e2b0346367a10fe.tar.bz2
caelestia-shell-137fd56bb28aafb6973194208e2b0346367a10fe.zip
feat: show osd on border hover
-rw-r--r--modules/background/Border.qml6
-rw-r--r--modules/osd/Osd.qml12
-rw-r--r--services/Drawers.qml20
3 files changed, 38 insertions, 0 deletions
diff --git a/modules/background/Border.qml b/modules/background/Border.qml
index e944299..143097a 100644
--- a/modules/background/Border.qml
+++ b/modules/background/Border.qml
@@ -68,6 +68,12 @@ Scope {
LayerShadow {
source: effect
}
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onPositionChanged: event => Drawers.setPosForScreen(root.screen, event.x, event.y)
+ }
}
ExclusionZone {
diff --git a/modules/osd/Osd.qml b/modules/osd/Osd.qml
index 009eb2f..f16b396 100644
--- a/modules/osd/Osd.qml
+++ b/modules/osd/Osd.qml
@@ -12,6 +12,7 @@ Variants {
required property ShellScreen modelData
readonly property Brightness.Monitor monitor: Brightness.getMonitorForScreen(modelData)
+ property int winHeight
property bool osdVisible
property bool hovered
@@ -50,6 +51,15 @@ Variants {
}
}
+ Connections {
+ target: Drawers
+
+ function onPosChanged(screen: ShellScreen, x: int, y: int): void {
+ if (screen === root.modelData && x > screen.width / 2 && y > (screen.height - root.winHeight) / 2 && y < (screen.height + root.winHeight) / 2)
+ root.show();
+ }
+ }
+
LazyLoader {
loading: true
@@ -68,6 +78,8 @@ Variants {
anchors.right: true
height: wrapper.height
+ Component.onCompleted: root.winHeight = height
+
Background {
id: bg
diff --git a/services/Drawers.qml b/services/Drawers.qml
new file mode 100644
index 0000000..1f524ab
--- /dev/null
+++ b/services/Drawers.qml
@@ -0,0 +1,20 @@
+pragma Singleton
+
+import Quickshell
+
+Singleton {
+ id: root
+
+ property var positions: ({})
+
+ signal posChanged(screen: ShellScreen, x: int, y: int)
+
+ function getPosForScreen(screen: ShellScreen): point {
+ return positions[screen] || Qt.point(0, 0);
+ }
+
+ function setPosForScreen(screen: ShellScreen, x: int, y: int): void {
+ positions[screen] = Qt.point(x, y);
+ posChanged(screen, x, y);
+ }
+}