Files
DeltaruneQuickshell/Shell/Overlay.qml
2026-01-24 14:35:16 +02:00

74 lines
1.7 KiB
QML

import QtQuick
import Quickshell
import Quickshell.Wayland
import Quickshell.Hyprland
import "Windows/QuickSettings"
PanelWindow {
id: overlay
anchors {
top: true
left: true
right: true
bottom: true
}
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.focusable: true
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.namespace: "deltarune-quickshell-overlay"
visible: ShellStateManager.shellOpen
exclusionMode: ExclusionMode.Ignore
aboveWindows: true
focusable: ShellStateManager.shellOpen
color: "#00000000"
HyprlandFocusGrab {
id: grab
active: true
windows: [overlay]
}
FocusScope {
id: overlayFocus
anchors.fill: parent
focus: ShellStateManager.shellOpen
Component.onCompleted: {
if (ShellStateManager.shellOpen)
overlayFocus.forceActiveFocus();
}
onVisibleChanged: if (visible)
overlayFocus.forceActiveFocus()
onFocusChanged: {
if (focus && ShellStateManager.shellOpen)
overlayFocus.forceActiveFocus();
}
Keys.onReleased: function (event) {
if (!ShellStateManager.shellOpen)
return;
if (ShellInputManager.handleKey(event)) {
event.accepted = true;
}
}
}
Connections {
target: ShellStateManager
function onShellOpenChanged() {
if (ShellStateManager.shellOpen)
overlayFocus.forceActiveFocus();
}
}
QuickSettings {
id: quickSettingsWindow
manager: ShellStateManager
}
}