QmlDesigner: Fix issue with gradient editing

The gradient only has to be deleted if we are in gradient editing mode.
If we are not in gradient editing mode, we should not delete any gradient.

This was creating issues when editing border.color.

Task-number: QDS-675
Change-Id: Ie3fcbc4a817cb0062e895298d42794b7338084d6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-05-21 11:49:39 +02:00
parent cb71f6ec5f
commit bd2aa8ada3

View File

@@ -103,7 +103,7 @@ Column {
}
onHasGradientChanged: {
if (!supportGradient)
if (!colorEditor.supportGradient)
return
if (gradientLine.hasGradient) {
@@ -217,7 +217,9 @@ Column {
iconSource: "images/icon_color_solid.png"
onClicked: {
if (colorEditor.supportGradient)
gradientLine.deleteGradient()
textField.text = colorEditor.color
colorEditor.backendValue.resetValue()
}
@@ -472,6 +474,7 @@ Column {
iconSource: "images/icon_color_none.png"
onClicked: {
colorEditor.color = "#00000000"
if (colorEditor.supportGradient)
gradientLine.deleteGradient()
}
tooltip: qsTr("Transparent")