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
|
|
@ -3,9 +3,10 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Modules.Settings.Tabs as Tabs
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "Tabs" as Tabs
|
||||
|
||||
|
||||
NLoader {
|
||||
id: root
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Network Settings"
|
||||
text: "Interfaces"
|
||||
font.pointSize: Style.fontSizeXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.textPrimary
|
||||
|
|
|
|||
|
|
@ -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