80 lines
1.8 KiB
QML
80 lines
1.8 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Wayland
|
|
import Quickshell.Hyprland
|
|
|
|
import "Windows/QuickSettings"
|
|
import "Windows/AppLauncher"
|
|
|
|
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
|
|
}
|
|
|
|
AppLauncher {
|
|
id: appLauncherWindow
|
|
manager: ShellStateManager
|
|
}
|
|
}
|