diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-04 22:11:03 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-04 22:11:03 +1000 |
| commit | a575245d7b9f084110ce062b35d908ceeda260ab (patch) | |
| tree | 72e727d41577c99126f94421681eb0f17592c93d /modules | |
| parent | feat: audio osd (diff) | |
| download | caelestia-shell-a575245d7b9f084110ce062b35d908ceeda260ab.tar.gz caelestia-shell-a575245d7b9f084110ce062b35d908ceeda260ab.tar.bz2 caelestia-shell-a575245d7b9f084110ce062b35d908ceeda260ab.zip | |
feat: brightness osd
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/osd/Content.qml | 4 | ||||
| -rw-r--r-- | modules/osd/Osd.qml | 60 |
2 files changed, 37 insertions, 27 deletions
diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml index daab4e2..b224bf6 100644 --- a/modules/osd/Content.qml +++ b/modules/osd/Content.qml @@ -7,7 +7,7 @@ import QtQuick Column { id: root - required property ShellScreen screen + required property Brightness.Monitor monitor padding: Appearance.padding.large @@ -35,6 +35,8 @@ Column { VerticalSlider { icon: "brightness_6" + value: root.monitor?.brightness ?? 0 + onMoved: root.monitor?.setBrightness(value) implicitWidth: OsdConfig.sizes.sliderWidth implicitHeight: OsdConfig.sizes.sliderHeight 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 } } } |