From 6557b683ea20fdd075eb2e8300dd5947e11803eb Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Tue, 21 Oct 2025 20:57:58 -0400 Subject: [PATCH] SettingsPanel: new method "openWidgetSettings" --- Modules/Bar/Widgets/SystemMonitor.qml | 9 +-------- Modules/Settings/SettingsPanel.qml | 11 +++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 0ad06912..691d08c1 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -352,14 +352,7 @@ Rectangle { acceptedButtons: Qt.RightButton onClicked: { var settingsPanel = PanelService.getPanel("settingsPanel") - settingsPanel.requestedTab = SettingsPanel.Tab.Bar - settingsPanel.requestedWidgetSettings = { - "widgetIndex": root.sectionWidgetIndex, - "widgetData": root.widgetSettings, - "widgetId": root.widgetId, - "sectionId": root.section - } - settingsPanel.open() + settingsPanel.openWidgetSettings(root.section, root.sectionWidgetIndex, root.widgetId, root.widgetSettings) } } } diff --git a/Modules/Settings/SettingsPanel.qml b/Modules/Settings/SettingsPanel.qml index 15661f91..3a0962c7 100644 --- a/Modules/Settings/SettingsPanel.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -240,6 +240,17 @@ NPanel { root.currentTabIndex = initialIndex } + function openWidgetSettings(section, widgetIndex, widgetId, widgetData) { + settingsPanel.requestedWidgetSettings = { + "sectionId": section, + "widgetIndex": widgetIndex, + "widgetId": widgetId, + "widgetData": widgetData + } + settingsPanel.requestedTab = SettingsPanel.Tab.Bar + settingsPanel.open() + } + // Add scroll functions function scrollDown() { if (activeScrollView && activeScrollView.ScrollBar.vertical) {