forked from qt-creator/qt-creator
PropertyEditor.QmlDesigner: Fix the color LineEdit
Using hasToConvertColor to handle the alpha channel. Change-Id: I6b6e2ef4361efb7aba3adaf549cbddd625145e33 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -68,7 +68,6 @@ Column {
|
|||||||
onColorChanged: {
|
onColorChanged: {
|
||||||
if (!gradientLine.isCompleted)
|
if (!gradientLine.isCompleted)
|
||||||
return;
|
return;
|
||||||
textField.text = gradientLine.colorToString(color);
|
|
||||||
|
|
||||||
if (supportGradient && gradientLine.visible)
|
if (supportGradient && gradientLine.visible)
|
||||||
gradientLine.currentColor = color
|
gradientLine.currentColor = color
|
||||||
@@ -132,6 +131,8 @@ Column {
|
|||||||
LineEdit {
|
LineEdit {
|
||||||
id: textField
|
id: textField
|
||||||
|
|
||||||
|
hasToConvertColor: true
|
||||||
|
|
||||||
validator: RegExpValidator {
|
validator: RegExpValidator {
|
||||||
regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g
|
regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g
|
||||||
}
|
}
|
||||||
@@ -141,8 +142,9 @@ Column {
|
|||||||
backendValue: colorEditor.backendendValue
|
backendValue: colorEditor.backendendValue
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
colorEditor.color = textField.text
|
colorEditor.color = colorFromString(textField.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
ColorCheckButton {
|
ColorCheckButton {
|
||||||
|
|||||||
Reference in New Issue
Block a user