diff --git a/Modules/AppLauncher/AppLauncher.qml b/Modules/AppLauncher/AppLauncher.qml index 502f95d..89d8ca6 100644 --- a/Modules/AppLauncher/AppLauncher.qml +++ b/Modules/AppLauncher/AppLauncher.qml @@ -12,15 +12,12 @@ import qs.Widgets import "../../Helpers/FuzzySort.js" as Fuzzysort -NLoader { - id: appLauncher - isLoaded: false - - content: Component { NPanel { - id: appLauncherPanel + id: root + panelWidth: Math.min(700 * scaling, screen?.width * 0.75) + panelHeight: Math.min(550 * scaling, screen?.height * 0.8) + panelAnchorCentered: true - WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand // Import modular components Calculator { @@ -158,7 +155,7 @@ NLoader { } else { modelData.execute() } - appLauncherPanel.hide() + root.close() } } @@ -174,14 +171,7 @@ NLoader { } // Main content container - Rectangle { - anchors.centerIn: parent - width: Math.min(700 * scaling, parent.width * 0.75) - height: Math.min(550 * scaling, parent.height * 0.8) - radius: Style.radiusL * scaling - color: Color.mSurface - border.color: Color.mOutline - border.width: Style.borderS * scaling + panelContent: Rectangle { // Subtle gradient background gradient: Gradient { @@ -262,7 +252,7 @@ NLoader { Keys.onUpPressed: selectPrev() Keys.onEnterPressed: activateSelected() Keys.onReturnPressed: activateSelected() - Keys.onEscapePressed: appLauncherPanel.hide() + Keys.onEscapePressed: root.close() } } @@ -453,5 +443,3 @@ NLoader { } } } - } -} diff --git a/Modules/Bar/Tray.qml b/Modules/Bar/Tray.qml index ee12a69..c6ba8c9 100644 --- a/Modules/Bar/Tray.qml +++ b/Modules/Bar/Tray.qml @@ -134,6 +134,10 @@ Rectangle { function open() { visible = true + + // Register into the panel service + // so this will autoclose if we open another panel + PanelService.registerOpen(trayPanel) } function close() { diff --git a/Modules/IPC/IPCManager.qml b/Modules/IPC/IPCManager.qml index 28107c2..83e350a 100644 --- a/Modules/IPC/IPCManager.qml +++ b/Modules/IPC/IPCManager.qml @@ -1,4 +1,5 @@ import QtQuick +import Quickshell import Quickshell.Io import qs.Services @@ -9,7 +10,7 @@ Item { target: "settings" function toggle() { - settingsPanel.isLoaded = !settingsPanel.isLoaded + settingsPanel.toggle(Quickshell.screens[0]) } } @@ -17,7 +18,7 @@ Item { target: "notifications" function toggleHistory() { - notificationHistoryPanel.isLoaded = !notificationHistoryPanel.isLoaded + notificationHistoryPanel.toggle(Quickshell.screens[0]) } function toggleDoNotDisturb() {// TODO @@ -36,7 +37,7 @@ Item { target: "appLauncher" function toggle() { - appLauncherPanel.isLoaded = !appLauncherPanel.isLoaded + appLauncherPanel.toggle(Quickshell.screens[0]) } }