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:
quadbyte 2025-08-12 18:58:22 -04:00
parent 0417590221
commit b3002b42b4
5 changed files with 23 additions and 17 deletions

View file

@ -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 {