nosignal-shell/modules/osd/Interactions.qml
2 * r + 2 * t 96429160c3 feat: user config file
Config file at `~/.config/caelestia/shell.json`
2025-06-15 18:08:45 +10:00

48 lines
952 B
QML

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: Config.osd.hideDelay
onTriggered: {
if (!root.hovered)
root.visibilities.osd = false;
}
}
}