Make "none" defaultValue of NColorChoice

This commit is contained in:
Thibault Martin
2026-02-14 14:18:45 +01:00
parent 8e19db1ce5
commit 2f6bf06270
2 changed files with 8 additions and 7 deletions
@@ -56,7 +56,6 @@ ColumnLayout {
label: I18n.tr("common.select-icon-color")
description: I18n.tr("common.select-color-description")
currentKey: valueIconColor
defaultValue: "none"
onSelected: key => {
valueIconColor = key;
saveSettings();
+8 -6
View File
@@ -10,13 +10,15 @@ RowLayout {
property string description: ""
property string tooltip: ""
property string currentKey: ""
property var defaultValue: undefined
property var defaultValue: "none"
property int circleSize: Style.baseWidgetSize * 0.9
// Private properties
readonly property bool isValueChanged: (defaultValue !== undefined) && (currentKey !== defaultValue)
readonly property string indicatorTooltip: defaultValue !== undefined ? I18n.tr("panels.indicator.default-value", {
"value": defaultValue === "" ? "(empty)" : String(defaultValue)
}) : ""
readonly property bool isValueChanged: currentKey !== defaultValue
readonly property string indicatorTooltip: {
I18n.tr("panels.indicator.default-value", {
"value": defaultValue === "" ? "(empty)" : String(defaultValue)
});
}
signal selected(string key)