Early Progress of SettingsWindow

This commit is contained in:
Ly-sec 2025-08-11 15:49:48 +02:00
parent 5543b58c3c
commit dc621647d7
14 changed files with 499 additions and 4 deletions

View file

@ -10,6 +10,8 @@ NBox {
id: root
readonly property real scaling: Scaling.scale(screen)
// Hold a single instance of the Settings window (root is NLoader)
property var settingsWindow: null
Layout.fillWidth: true
// Height driven by content
@ -71,6 +73,23 @@ NBox {
NIconButton {
icon: "settings"
sizeMultiplier: 0.9
onClicked: function () {
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
}
}
}
NIconButton {
icon: "power_settings_new"