PanelManager autoclose working!
This commit is contained in:
parent
b3002b42b4
commit
c5b7be4119
3 changed files with 4 additions and 5 deletions
|
|
@ -6,5 +6,6 @@ import qs.Modules.Settings
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property var openedPanel: null
|
||||||
property SettingsWindow settingsWindow: null
|
property SettingsWindow settingsWindow: null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ Singleton {
|
||||||
// Used to access via Settings.data.xxx.yyy
|
// Used to access via Settings.data.xxx.yyy
|
||||||
property var data: adapter
|
property var data: adapter
|
||||||
|
|
||||||
// Needed to only have one NPanel loaded at a time. <--- VERY BROKEN
|
|
||||||
//property var openPanel: null
|
|
||||||
Item {
|
Item {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ PanelWindow {
|
||||||
function show() {
|
function show() {
|
||||||
// Ensure only one panel is visible at a time using Settings as ephemeral store
|
// Ensure only one panel is visible at a time using Settings as ephemeral store
|
||||||
try {
|
try {
|
||||||
if (Settings.openPanel && Settings.openPanel !== root && Settings.openPanel.hide) {
|
if (PanelManager.openedPanel && PanelManager.openedPanel !== root && PanelManager.openedPanel.hide) {
|
||||||
Settings.openPanel.hide()
|
PanelManager.openedPanel.hide()
|
||||||
}
|
}
|
||||||
Settings.openPanel = root
|
PanelManager.openedPanel = root
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
||||||
// ignore
|
// ignore
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue