Commit be9a0caa authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.PropertyEditor: Fix the small color button for gradients



The small ColorCheckButton has to preview the same color as the rest
of the color editor. Before this patch it was showing the color
defined in the backend as rectangle color.
This is not correct in gradient editing mode.
Also the binding in Colorbutton was deleted assigning values
directly.

Task-number: QTCREATORBUG-12204
Change-Id: Iad5263ccccba10fdb4f2b757f6965d500c50ac53
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent ee200a7b
...@@ -34,6 +34,7 @@ import QtQuick.Controls 1.0 as Controls ...@@ -34,6 +34,7 @@ import QtQuick.Controls 1.0 as Controls
Column { Column {
id: colorEditor
width: parent.width - 8 width: parent.width - 8
...@@ -50,7 +51,11 @@ Column { ...@@ -50,7 +51,11 @@ Column {
property alias gradientPropertyName: gradientLine.gradientPropertyName property alias gradientPropertyName: gradientLine.gradientPropertyName
onValueChanged: { onValueChanged: {
color = value colorEditor.color = colorEditor.value
}
onBackendendValueChanged: {
colorEditor.color = colorEditor.value
} }
Timer { Timer {
...@@ -63,8 +68,6 @@ Column { ...@@ -63,8 +68,6 @@ Column {
} }
} }
id: colorEditor
onColorChanged: { onColorChanged: {
if (!gradientLine.isCompleted) if (!gradientLine.isCompleted)
return; return;
...@@ -164,7 +167,7 @@ Column { ...@@ -164,7 +167,7 @@ Column {
} }
ColorCheckButton { ColorCheckButton {
id: checkButton id: checkButton
color: backendendValue.value color: colorEditor.color
} }
ButtonRow { ButtonRow {
...@@ -205,7 +208,13 @@ Column { ...@@ -205,7 +208,13 @@ Column {
} }
ColorButton { ColorButton {
color: colorEditor.color property color bindedColor: colorEditor.color
//prevent the binding to be deleted by assignment
onBindedColorChanged: {
colorButton.color = colorButton.bindedColor
}
enabled: buttonRow.checkedIndex !== 2 enabled: buttonRow.checkedIndex !== 2
opacity: checkButton.checked ? 1 : 0 opacity: checkButton.checked ? 1 : 0
id: colorButton id: colorButton
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment