summaryrefslogtreecommitdiff
path: root/modules/osd/Osd.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-04 22:11:03 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-04 22:11:03 +1000
commita575245d7b9f084110ce062b35d908ceeda260ab (patch)
tree72e727d41577c99126f94421681eb0f17592c93d /modules/osd/Osd.qml
parentfeat: audio osd (diff)
downloadcaelestia-shell-a575245d7b9f084110ce062b35d908ceeda260ab.tar.gz
caelestia-shell-a575245d7b9f084110ce062b35d908ceeda260ab.tar.bz2
caelestia-shell-a575245d7b9f084110ce062b35d908ceeda260ab.zip
feat: brightness osd
Diffstat (limited to 'modules/osd/Osd.qml')
-rw-r--r--modules/osd/Osd.qml60
1 files changed, 34 insertions, 26 deletions
diff --git a/modules/osd/Osd.qml b/modules/osd/Osd.qml
index 4d744f6..4d6ab7e 100644
--- a/modules/osd/Osd.qml
+++ b/modules/osd/Osd.qml
@@ -4,47 +4,55 @@ import "root:/config"
import Quickshell
import QtQuick
-Scope {
- id: root
+Variants {
+ model: Quickshell.screens
- property bool osdVisible
+ Scope {
+ id: root
- function show(): void {
- root.osdVisible = true;
- timer.restart();
- }
-
- Connections {
- target: Audio
+ required property ShellScreen modelData
+ readonly property Brightness.Monitor monitor: Brightness.getMonitorForScreen(modelData)
+ property bool osdVisible
- function onMutedChanged(): void {
- root.show();
+ function show(): void {
+ root.osdVisible = true;
+ timer.restart();
}
- function onVolumeChanged(): void {
- root.show();
+ Connections {
+ target: Audio
+
+ function onMutedChanged(): void {
+ root.show();
+ }
+
+ function onVolumeChanged(): void {
+ root.show();
+ }
}
- }
- Timer {
- id: timer
+ Connections {
+ target: root.monitor
- interval: OsdConfig.hideDelay
- onTriggered: root.osdVisible = false
- }
+ function onBrightnessChanged(): void {
+ root.show();
+ }
+ }
- Variants {
- model: Quickshell.screens
+ Timer {
+ id: timer
+
+ interval: OsdConfig.hideDelay
+ onTriggered: root.osdVisible = false
+ }
LazyLoader {
loading: true
- required property ShellScreen modelData
-
StyledWindow {
id: win
- screen: parent.modelData
+ screen: root.modelData
name: "osd"
visible: wrapper.shouldBeVisible
@@ -80,7 +88,7 @@ Scope {
Content {
id: content
- screen: parent.modelData
+ monitor: root.monitor
}
}
}