forked from Shinonome/dots-hyprland
volume osd: only show on focused screen
This commit is contained in:
@@ -12,6 +12,7 @@ import Quickshell.Hyprland
|
|||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
property bool showOsdValues: false
|
property bool showOsdValues: false
|
||||||
|
property ShellScreen focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name)
|
||||||
|
|
||||||
function triggerOsd() {
|
function triggerOsd() {
|
||||||
showOsdValues = true
|
showOsdValues = true
|
||||||
@@ -47,23 +48,26 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Variants {
|
|
||||||
model: Quickshell.screens
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: osdLoader
|
id: osdLoader
|
||||||
property var modelData
|
|
||||||
active: showOsdValues
|
active: showOsdValues
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
screen: modelData
|
id: osdRoot
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root
|
||||||
|
function onFocusedScreenChanged() {
|
||||||
|
osdRoot.screen = root.focusedScreen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exclusionMode: ExclusionMode.Normal
|
exclusionMode: ExclusionMode.Normal
|
||||||
WlrLayershell.namespace: "quickshell:onScreenDisplay"
|
WlrLayershell.namespace: "quickshell:onScreenDisplay"
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors.top: true
|
||||||
top: true
|
|
||||||
}
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: osdValuesWrapper
|
item: osdValuesWrapper
|
||||||
}
|
}
|
||||||
@@ -111,8 +115,6 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
target: "osdVolume"
|
target: "osdVolume"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user