diff --git a/Modules/Bar/Clock.qml b/Modules/Bar/Clock.qml index 19d25e8..916687f 100644 --- a/Modules/Bar/Clock.qml +++ b/Modules/Bar/Clock.qml @@ -13,7 +13,7 @@ NClock { } onEntered: { - if (!calendar.isLoaded) { + if (!calendarPanel.isLoaded) { tooltip.show() } } @@ -22,6 +22,6 @@ NClock { } onClicked: { tooltip.hide() - calendar.isLoaded = !calendar.isLoaded + calendarPanel.isLoaded = !calendarPanel.isLoaded } } diff --git a/Modules/DemoPanel/DemoPanel.qml b/Modules/Demo/DemoPanel.qml similarity index 100% rename from Modules/DemoPanel/DemoPanel.qml rename to Modules/Demo/DemoPanel.qml diff --git a/Modules/Settings/SettingsWindow.qml b/Modules/Settings/SettingsPanel.qml similarity index 92% rename from Modules/Settings/SettingsWindow.qml rename to Modules/Settings/SettingsPanel.qml index e388186..a9f0ca5 100644 --- a/Modules/Settings/SettingsWindow.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -13,7 +13,7 @@ NLoader { content: Component { NPanel { - id: settingsPanel + id: panel WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand @@ -105,11 +105,11 @@ NLoader { Repeater { id: sections - model: settingsPanel.tabsModel + model: panel.tabsModel delegate: Rectangle { id: tabItem - readonly property bool selected: index === settingsPanel.currentTabIndex + readonly property bool selected: index === panel.currentTabIndex width: parent.width height: 32 * scaling // Back to original height radius: Style.radiusSmall * scaling @@ -149,7 +149,7 @@ NLoader { onEntered: tabItem.hovering = true onExited: tabItem.hovering = false onCanceled: tabItem.hovering = false - onClicked: settingsPanel.currentTabIndex = index + onClicked: panel.currentTabIndex = index } } } @@ -178,19 +178,18 @@ NLoader { Layout.fillWidth: true spacing: Style.marginSmall * scaling NText { - text: settingsPanel.tabsModel[settingsPanel.currentTabIndex].label + text: panel.tabsModel[panel.currentTabIndex].label font.pointSize: Style.fontSizeLarge * scaling font.weight: Style.fontWeightBold color: Colors.textPrimary Layout.fillWidth: true } NIconButton { - id: demoPanelToggle icon: "close" - tooltipText: "Close settings panel" + tooltipText: "Close" Layout.alignment: Qt.AlignVCenter onClicked: { - settingsWindow.isLoaded = !settingsWindow.isLoaded + settingsPanel.isLoaded = !settingsPanel.isLoaded } } } @@ -203,7 +202,7 @@ NLoader { id: stack Layout.fillWidth: true Layout.fillHeight: true - currentIndex: settingsPanel.currentTabIndex + currentIndex: panel.currentTabIndex Tabs.General {} Tabs.Bar {} diff --git a/Modules/SidePanel/Cards/ProfileCard.qml b/Modules/SidePanel/Cards/ProfileCard.qml index 83f39c4..90a23db 100644 --- a/Modules/SidePanel/Cards/ProfileCard.qml +++ b/Modules/SidePanel/Cards/ProfileCard.qml @@ -12,9 +12,6 @@ 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 - property string uptimeText: "--" Layout.fillWidth: true @@ -59,8 +56,9 @@ NBox { } NIconButton { icon: "settings" + tooltipText: "Open settings" onClicked: { - PanelManager.settingsWindow.isLoaded = !PanelManager.settingsWindow.isLoaded + settingsPanel.isLoaded = !settingsPanel.isLoaded } } NIconButton { diff --git a/Services/PanelManager.qml b/Services/PanelManager.qml index 254ea0f..1c50d60 100644 --- a/Services/PanelManager.qml +++ b/Services/PanelManager.qml @@ -7,5 +7,4 @@ Singleton { id: root property var openedPanel: null - property SettingsWindow settingsWindow: null } diff --git a/shell.qml b/shell.qml index fa36846..f1e589b 100644 --- a/shell.qml +++ b/shell.qml @@ -8,7 +8,7 @@ import qs.Widgets import qs.Modules.Audio import qs.Modules.Bar import qs.Modules.Calendar -import qs.Modules.DemoPanel +import qs.Modules.Demo import qs.Modules.Background import qs.Modules.SidePanel import qs.Modules.Notification @@ -31,25 +31,20 @@ ShellRoot { id: sidePanel } + Calendar { + id: calendarPanel + } + + SettingsPanel { + id: settingsPanel + } + Notification { id: notification } - Calendar { - id: calendar - } - - SettingsWindow { - id: settingsWindow - } - Component.onCompleted: { - PanelManager.settingsWindow = settingsWindow - - // Ensure our singleton is created as soon as possible - // so we start fetching weather asap if necessary + // Ensure our singleton is created as soon as possible so we start fetching weather asap Location.init() - - } }