From c0cae37d6aaa01df71223dba0ae66c4760cc83a8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@digia.com> Date: Wed, 23 Oct 2013 17:36:04 +0200 Subject: [PATCH] QmlDesigner.PropertyEditor: fixing color editing Change-Id: I3102799952bace9c052f70f52489f5d768621f25 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> --- .../HelperWidgets/ColorEditor.qml | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml index f3044101c1e..ddf0f60c302 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml @@ -66,8 +66,10 @@ Column { onColorChanged: { textField.text = gradientLine.colorToString(color); gradientLine.currentColor = color - //Delay setting the color to keep ui responsive - colorEditorTimer.restart() + + if (buttonRow.checkedIndex !== 1) + //Delay setting the color to keep ui responsive + colorEditorTimer.restart() } GradientLine { @@ -105,10 +107,14 @@ Column { LineEdit { id: textField - inputMask: "\\#hhHHHHHH" + inputMask: "\\#HHHHHHhh" + + backendValue: colorEditor.backendendValue onAccepted: { - colorEditor.color = text + print("color") + print(textField.text) + colorEditor.color = textField.text } Layout.preferredWidth: 80 } @@ -124,26 +130,25 @@ Column { ButtonRowButton { iconSource: "images/icon_color_solid.png" + onClicked: { + colorEditor.backendendValue.resetValue(); + } } ButtonRowButton { visible: supportGradient iconSource: "images/icon_color_gradient.png" + onClicked: { + print("gradient") + } } ButtonRowButton { iconSource: "images/icon_color_none.png" - - } - - onToggled: { - if (index === 0) { - colorEditor.color = "#ffffff" - } - - if (index === 2) { + onClicked: { colorEditor.color = "#00000000" } + } } -- GitLab