summaryrefslogtreecommitdiff
path: root/modules/osd/Interactions.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-13 17:43:04 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-13 17:43:04 +1000
commit9c3e2fffbd31c3864ef7edc6212c1c601357f031 (patch)
tree78f45af391db6b7096da61342beceb3904e7819e /modules/osd/Interactions.qml
parentosd: show on hover (diff)
downloadcaelestia-shell-9c3e2fffbd31c3864ef7edc6212c1c601357f031.tar.gz
caelestia-shell-9c3e2fffbd31c3864ef7edc6212c1c601357f031.tar.bz2
caelestia-shell-9c3e2fffbd31c3864ef7edc6212c1c601357f031.zip
osd: fix show on hover + show on audio/brightness change
Diffstat (limited to 'modules/osd/Interactions.qml')
-rw-r--r--modules/osd/Interactions.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/osd/Interactions.qml b/modules/osd/Interactions.qml
new file mode 100644
index 0000000..eecf0b6
--- /dev/null
+++ b/modules/osd/Interactions.qml
@@ -0,0 +1,48 @@
+import "root:/services"
+import "root:/config"
+import Quickshell
+import QtQuick
+
+Scope {
+ id: root
+
+ required property ShellScreen screen
+ required property PersistentProperties visibilities
+ required property bool hovered
+ readonly property Brightness.Monitor monitor: Brightness.getMonitorForScreen(screen)
+
+ function show(): void {
+ root.visibilities.osd = true;
+ timer.restart();
+ }
+
+ Connections {
+ target: Audio
+
+ function onMutedChanged(): void {
+ root.show();
+ }
+
+ function onVolumeChanged(): void {
+ root.show();
+ }
+ }
+
+ Connections {
+ target: root.monitor
+
+ function onBrightnessChanged(): void {
+ root.show();
+ }
+ }
+
+ Timer {
+ id: timer
+
+ interval: OsdConfig.hideDelay
+ onTriggered: {
+ if (!root.hovered)
+ root.visibilities.osd = false;
+ }
+ }
+}