NPanel: clear openedPanel attempt

This commit is contained in:
LemmyCook 2025-09-04 10:16:37 -04:00
parent bb0f1e84ce
commit 7fafda4747
2 changed files with 11 additions and 1 deletions

View file

@ -12,9 +12,12 @@ Singleton {
// Currently opened panel
property var openedPanel: null
readonly property bool hasOpenedPanel: (openedPanel !== null)
property var registeredPanels: ({})
// Register this panel
function registerPanel(panel) {
registeredPanels[panel.objectName] = panel
@ -33,9 +36,15 @@ Singleton {
// Helper to keep only one panel open at any time
function willOpenPanel(panel) {
if (openedPanel && openedPanel != panel) {
if (openedPanel && openedPanel !== panel) {
openedPanel.close()
}
openedPanel = panel
}
function closedPanel(panel) {
if (openedPanel && openedPanel === panel) {
openedPanel = null
}
}
}

View file

@ -125,6 +125,7 @@ Loader {
root.closed()
active = false
useButtonPosition = false // Reset button position usage
PanelService.closedPanel(root)
}
// -----------------------------------------