Always prefix text in ColorDialog with a hashtag

CURA 8687
This commit is contained in:
casper 2022-02-11 13:48:57 +01:00
parent 959caece90
commit ca0d84dcae

View File

@ -41,7 +41,13 @@ UM.Dialog
selectByMouse: true
anchors.top: colorLabel.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{6})$/ }
onTextChanged: {
if (!text.startsWith("#"))
{
text = `#${text}`;
}
}
validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ }
}
Rectangle