mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user