feat: update osd for volume

This commit is contained in:
johannes committed 2026-08-26 22:12:40 +02:00
1 parent bb0ff9089f
commit 4d56835ade
4 files changed
+153 -75

No files matched your search

+13 -29
View File
@@ -4,6 +4,7 @@ import Quickshell.Io
import "components/Bar"
import "components/CommandPalette"
import "components/OSD"
import "components/Shared"
ShellRoot {
@@ -11,45 +12,24 @@ ShellRoot {
// --- Global State ---
property bool commandPaletteOpen: false
property bool commandPaletteOsdMode: false
IpcHandler {
target: "commandPalette"
function toggle() {
root.toggleCommandPalette();
}
function openOsd() {
root.showOsd();
commandPaletteOpen = !commandPaletteOpen;
}
}
function toggleCommandPalette() {
if (commandPaletteOpen && !commandPaletteOsdMode) {
commandPaletteOpen = false;
} else {
commandPaletteOsdMode = false;
commandPaletteOpen = true;
IpcHandler {
target: "osd"
function showVolume() {
osd.show("volume");
}
function showBrightness() {
osd.show("brightness");
}
}
function showOsd() {
commandPaletteOsdMode = true;
commandPaletteOpen = true;
osdHideTimer.restart();
}
Timer {
id: osdHideTimer
interval: 2000
onTriggered: {
if (root.commandPaletteOsdMode) {
root.commandPaletteOpen = false;
root.commandPaletteOsdMode = false;
}
}
}
// --------------------
Bar {
id: bar
rootState: root
@@ -59,4 +39,8 @@ ShellRoot {
id: commandPalette
rootState: root
}
OSD {
id: osd
}
}