From a2587258ff0e83895794a8126ad224bc740bc285 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Mon, 3 Nov 2025 16:08:52 -0500 Subject: [PATCH] Autoformatting --- .../ControlCenterWidgetSettingsDialog.qml | 8 ++- .../WidgetSettings/CustomButtonSettings.qml | 61 +++++++++++-------- Modules/Settings/Tabs/ControlCenterTab.qml | 10 +-- 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/Modules/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml b/Modules/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml index a0aaaa01..4b9c9fb1 100644 --- a/Modules/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml +++ b/Modules/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml @@ -50,7 +50,9 @@ Popup { Layout.fillWidth: true NText { - text: I18n.tr("system.widget-settings-title", { "widget": root.widgetId }) + text: I18n.tr("system.widget-settings-title", { + "widget": root.widgetId + }) pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mPrimary @@ -82,7 +84,9 @@ Popup { Layout.topMargin: Style.marginM spacing: Style.marginM - Item { Layout.fillWidth: true } + Item { + Layout.fillWidth: true + } NButton { text: I18n.tr("settings.control-center.shortcuts.dialog.cancel", "Cancel") diff --git a/Modules/Settings/ControlCenter/WidgetSettings/CustomButtonSettings.qml b/Modules/Settings/ControlCenter/WidgetSettings/CustomButtonSettings.qml index e7a613c0..3cd0cb9b 100644 --- a/Modules/Settings/ControlCenter/WidgetSettings/CustomButtonSettings.qml +++ b/Modules/Settings/ControlCenter/WidgetSettings/CustomButtonSettings.qml @@ -1,6 +1,6 @@ import QtQuick import QtQuick.Layouts -import QtQml.Models // Import ListModel +import QtQml.Models import qs.Commons import qs.Widgets @@ -31,9 +31,9 @@ ColumnLayout { var item = initialChecks[i] if (item && typeof item === "object") { _settings._stateChecksListModel.append({ - command: item.command || "", - icon: item.icon || "" - }) + "command": item.command || "", + "icon": item.icon || "" + }) } else { console.warn("⚠️ Invalid stateChecks entry at index " + i + ":", item) } @@ -53,14 +53,14 @@ ColumnLayout { _settings.stateChecksJson = JSON.stringify(savedStateChecksArray) return { - id: widgetData.id, - icon: _settings.icon, - onClicked: _settings.onClicked, - onRightClicked: _settings.onRightClicked, - onMiddleClicked: _settings.onMiddleClicked, - stateChecksJson: _settings.stateChecksJson, - generalTooltipText: _settings.generalTooltipText, - enableOnStateLogic: _settings.enableOnStateLogic + "id": widgetData.id, + "icon": _settings.icon, + "onClicked": _settings.onClicked, + "onRightClicked": _settings.onRightClicked, + "onMiddleClicked": _settings.onMiddleClicked, + "stateChecksJson": _settings.stateChecksJson, + "generalTooltipText": _settings.generalTooltipText, + "enableOnStateLogic": _settings.enableOnStateLogic } } @@ -166,7 +166,10 @@ ColumnLayout { Layout.fillWidth: true placeholderText: I18n.tr("settings.control-center.shortcuts.custom-button.state-checks.command") text: model.command - onEditingFinished: _settings._stateChecksListModel.set(currentIndex, { "command": text, "icon": model.icon }) + onEditingFinished: _settings._stateChecksListModel.set(currentIndex, { + "command": text, + "icon": model.icon + }) } RowLayout { @@ -186,16 +189,16 @@ ColumnLayout { onClicked: iconPickerDelegate.open() } - NIconButton { - icon: "close" - tooltipText: I18n.tr("settings.control-center.shortcuts.custom-button.state-checks.remove") - baseSize: Style?.buttonSizeS ?? 24 - colorBorder: Qt.alpha(Color.mOutline, Style.opacityLight) - colorBg: Color.mError - colorFg: Color.mOnError - colorBgHover: Qt.alpha(Color.mError, Style.opacityMedium) - colorFgHover: Color.mOnError - onClicked: _settings._stateChecksListModel.remove(currentIndex) + NIconButton { + icon: "close" + tooltipText: I18n.tr("settings.control-center.shortcuts.custom-button.state-checks.remove") + baseSize: Style?.buttonSizeS ?? 24 + colorBorder: Qt.alpha(Color.mOutline, Style.opacityLight) + colorBg: Color.mError + colorFg: Color.mOnError + colorBgHover: Qt.alpha(Color.mError, Style.opacityMedium) + colorFgHover: Color.mOnError + onClicked: _settings._stateChecksListModel.remove(currentIndex) } } } @@ -204,14 +207,17 @@ ColumnLayout { id: iconPickerDelegate initialIcon: model.icon onIconSelected: function (iconName) { - _settings._stateChecksListModel.set(currentIndex, { "command": model.command, "icon": iconName }) + _settings._stateChecksListModel.set(currentIndex, { + "command": model.command, + "icon": iconName + }) } } NDivider { id: divider anchors.bottom: parent.bottom - visible: index < _settings._stateChecksListModel.count - 1 // Only show divider if not the last item + visible: index < _settings._stateChecksListModel.count - 1 // Only show divider if not the last item } } } @@ -222,7 +228,10 @@ ColumnLayout { NButton { text: I18n.tr("settings.control-center.shortcuts.custom-button.state-checks.add") - onClicked: _settings._stateChecksListModel.append({ command: "", icon: "" }) + onClicked: _settings._stateChecksListModel.append({ + "command": "", + "icon": "" + }) } Item { diff --git a/Modules/Settings/Tabs/ControlCenterTab.qml b/Modules/Settings/Tabs/ControlCenterTab.qml index 69f08b77..9e1af40e 100644 --- a/Modules/Settings/Tabs/ControlCenterTab.qml +++ b/Modules/Settings/Tabs/ControlCenterTab.qml @@ -70,11 +70,11 @@ ColumnLayout { availableWidgets.clear() var sortedEntries = ControlCenterWidgetRegistry.getAvailableWidgets().slice().sort() sortedEntries.forEach(entry => { - availableWidgets.append({ - "key": entry, - "name": entry - }) - }) + availableWidgets.append({ + "key": entry, + "name": entry + }) + }) // Starts empty cardsModel = []