osd: pause hide on hover
This commit is contained in:
parent
a575245d7b
commit
d95c134717
2 changed files with 22 additions and 3 deletions
|
|
@ -13,6 +13,7 @@ Variants {
|
|||
required property ShellScreen modelData
|
||||
readonly property Brightness.Monitor monitor: Brightness.getMonitorForScreen(modelData)
|
||||
property bool osdVisible
|
||||
property bool hovered
|
||||
|
||||
function show(): void {
|
||||
root.osdVisible = true;
|
||||
|
|
@ -43,7 +44,10 @@ Variants {
|
|||
id: timer
|
||||
|
||||
interval: OsdConfig.hideDelay
|
||||
onTriggered: root.osdVisible = false
|
||||
onTriggered: {
|
||||
if (!root.hovered)
|
||||
root.osdVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
|
|
@ -91,6 +95,19 @@ Variants {
|
|||
monitor: root.monitor
|
||||
}
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: hoverHandler
|
||||
|
||||
parent: win
|
||||
onHoveredChanged: {
|
||||
root.hovered = hovered;
|
||||
if (hovered)
|
||||
timer.stop();
|
||||
else
|
||||
root.osdVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ Singleton {
|
|||
|
||||
Process {
|
||||
id: getClients
|
||||
command: ["sh", "-c", "hyprctl -j clients | jq -c"]
|
||||
command: ["hyprctl", "-j", "clients"]
|
||||
stdout: SplitParser {
|
||||
splitMarker: ""
|
||||
onRead: data => {
|
||||
const clients = JSON.parse(data);
|
||||
const rClients = root.clients;
|
||||
|
|
@ -69,8 +70,9 @@ Singleton {
|
|||
|
||||
Process {
|
||||
id: getActiveClient
|
||||
command: ["sh", "-c", "hyprctl -j activewindow | jq -c"]
|
||||
command: ["hyprctl", "-j", "activewindow"]
|
||||
stdout: SplitParser {
|
||||
splitMarker: ""
|
||||
onRead: data => {
|
||||
const client = JSON.parse(data);
|
||||
root.activeClient = client.address ? clientComp.createObject(root, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue