From 55c7f344b3c71589c6cde124f220cfe3a214d5dd Mon Sep 17 00:00:00 2001 From: loner <2788892716@qq.com> Date: Mon, 6 Apr 2026 07:35:10 +0800 Subject: [PATCH] fix(ui): improve CustomButton settings visibility logic - Show icon toggle depends on textCommand input - Add fallback for valueShowIcon (default true) and valueEnableColorization (default false) - Reorder settings: Show Icon, Icon, iconPosition, enableColorization, colorizeSystemIcon --- .../WidgetSettings/CustomButtonSettings.qml | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml index 3bb8920c7..348b0b834 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml @@ -72,8 +72,22 @@ ColumnLayout { settingsChanged(settings); } + NToggle { + id: showIconToggle + label: I18n.tr("bar.custom-button.show-icon-label") + description: I18n.tr("bar.custom-button.show-icon-description") + checked: valueShowIcon + onToggled: checked => { + valueShowIcon = checked; + saveSettings(); + } + visible: textCommandInput.text !== "" + defaultValue: widgetMetadata.showIcon + } + RowLayout { spacing: Style.marginM + visible: valueShowIcon NLabel { label: I18n.tr("common.icon") @@ -134,19 +148,6 @@ ColumnLayout { defaultValue: widgetMetadata.iconPosition } - NToggle { - id: showIconToggle - label: I18n.tr("bar.custom-button.show-icon-label") - description: I18n.tr("bar.custom-button.show-icon-description") - checked: valueShowIcon - onToggled: checked => { - valueShowIcon = checked; - saveSettings(); - } - visible: textCommandInput.text !== "" - defaultValue: widgetMetadata.showIcon - } - NToggle { label: I18n.tr("bar.custom-button.enable-colorization-label") description: I18n.tr("bar.custom-button.enable-colorization-description") @@ -155,11 +156,12 @@ ColumnLayout { valueEnableColorization = checked; saveSettings(); } + visible: valueShowIcon defaultValue: widgetMetadata.enableColorization } NColorChoice { - visible: valueEnableColorization + visible: valueShowIcon && valueEnableColorization label: I18n.tr("common.select-icon-color") description: I18n.tr("bar.custom-button.color-selection-description") currentKey: valueColorizeSystemIcon