volume osd: only show on focused screen

This commit is contained in:
end-4
2025-05-18 00:26:42 +02:00
parent 4fa53bb4fc
commit 27ca14d208
@@ -12,6 +12,7 @@ import Quickshell.Hyprland
Scope {
id: root
property bool showOsdValues: false
property ShellScreen focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name)
function triggerOsd() {
showOsdValues = true
@@ -47,23 +48,26 @@ Scope {
}
}
Variants {
model: Quickshell.screens
Loader {
id: osdLoader
property var modelData
active: showOsdValues
PanelWindow {
screen: modelData
id: osdRoot
Connections {
target: root
function onFocusedScreenChanged() {
osdRoot.screen = root.focusedScreen
}
}
exclusionMode: ExclusionMode.Normal
WlrLayershell.namespace: "quickshell:onScreenDisplay"
WlrLayershell.layer: WlrLayer.Overlay
color: "transparent"
anchors {
top: true
}
anchors.top: true
mask: Region {
item: osdValuesWrapper
}
@@ -111,8 +115,6 @@ Scope {
}
}
}
IpcHandler {
target: "osdVolume"