nixnew/modules/user/modules/quickshell/shell/launcher/Controller.qml
2026-01-04 00:20:14 -08:00

77 lines
1.4 KiB
QML

pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Widgets
import Quickshell.Hyprland
Singleton {
PersistentProperties {
id: persist
property bool launcherOpen: false;
}
IpcHandler {
target: "launcher"
function open(): void {
persist.launcherOpen = true;
}
function close(): void {
persist.launcherOpen = false;
}
function toggle(): void {
persist.launcherOpen = !persist.launcherOpen
}
}
LazyLoader {
id: loader
activeAsync: persist.launcherOpen
PanelWindow {
id: launcherWindow
//anchors { left: true; right: true; top: true; bottom: true }
color: "transparent"
implicitWidth: content.width
implicitHeight: content.height
//color: "#20ff0000"
//WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.namespace: "shell:launcher"
/*HyprlandWindow.visibleMask: Region {
item: content
}*/
HyprlandFocusGrab {
windows: [launcherWindow]
active: true
//onCleared: console.log("cleared")
onCleared: persist.launcherOpen = false
}
MouseArea {
anchors.fill: parent
onPressed: persist.launcherOpen = false
MouseArea {
anchors.centerIn: parent
width: content.width
height: content.height
LaunchContent { id: content }
}
}
}
}
function init() {}
}