From c5b7be411926979535b7d3b21dc3ea9b676df501 Mon Sep 17 00:00:00 2001 From: quadbyte Date: Tue, 12 Aug 2025 19:04:16 -0400 Subject: [PATCH] PanelManager autoclose working! --- Services/PanelManager.qml | 1 + Services/Settings.qml | 2 -- Widgets/NPanel.qml | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Services/PanelManager.qml b/Services/PanelManager.qml index b7cbde5..254ea0f 100644 --- a/Services/PanelManager.qml +++ b/Services/PanelManager.qml @@ -6,5 +6,6 @@ import qs.Modules.Settings Singleton { id: root + property var openedPanel: null property SettingsWindow settingsWindow: null } diff --git a/Services/Settings.qml b/Services/Settings.qml index 39df007..7cf43a3 100644 --- a/Services/Settings.qml +++ b/Services/Settings.qml @@ -26,8 +26,6 @@ Singleton { // Used to access via Settings.data.xxx.yyy property var data: adapter - // Needed to only have one NPanel loaded at a time. <--- VERY BROKEN - //property var openPanel: null Item { Component.onCompleted: { diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index 704defc..97b3eb0 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -21,10 +21,10 @@ PanelWindow { function show() { // Ensure only one panel is visible at a time using Settings as ephemeral store try { - if (Settings.openPanel && Settings.openPanel !== root && Settings.openPanel.hide) { - Settings.openPanel.hide() + if (PanelManager.openedPanel && PanelManager.openedPanel !== root && PanelManager.openedPanel.hide) { + PanelManager.openedPanel.hide() } - Settings.openPanel = root + PanelManager.openedPanel = root } catch (e) { // ignore