feat: input mgr
This commit is contained in:
73
Shell/Overlay.qml
Normal file
73
Shell/Overlay.qml
Normal file
@@ -0,0 +1,73 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user