SettingsWindow Loading
- reworked the way we load the settings to avoid using Qt.createComponent which breaks hot reload and more - introduced a new PanelManager singleton to hold some references to some panels and later will be used to force having a single panel opened at all time
This commit is contained in:
parent
0417590221
commit
b3002b42b4
5 changed files with 23 additions and 17 deletions
|
|
@ -60,21 +60,7 @@ NBox {
|
|||
NIconButton {
|
||||
icon: "settings"
|
||||
onClicked: {
|
||||
if (!root.settingsWindow) {
|
||||
const comp = Qt.createComponent("../../Settings/SettingsWindow.qml")
|
||||
if (comp.status === Component.Ready) {
|
||||
root.settingsWindow = comp.createObject(root)
|
||||
} else {
|
||||
comp.statusChanged.connect(function () {
|
||||
if (comp.status === Component.Ready) {
|
||||
root.settingsWindow = comp.createObject(root)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (root.settingsWindow) {
|
||||
root.settingsWindow.isLoaded = !root.settingsWindow.isLoaded
|
||||
}
|
||||
PanelManager.settingsWindow.isLoaded = !PanelManager.settingsWindow.isLoaded
|
||||
}
|
||||
}
|
||||
NIconButton {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue