QmlDesigner.PropertyEditor: Fix control for saturation

If the lightness or saturation are 0 then hue is undefined.
If lightness is 0 then saturation is undefined/0.

Nevertheless we should keep the old values in the ui, because
the user should not loose the values in case he increases lightness
or saturation later.

Change-Id: I9fd80f6ca84fa08ef62d9fbb6dd4afce992c3546
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Thomas Hartmann
2015-01-05 14:35:22 +01:00
committed by Thomas Hartmann
parent a5e2b4b149
commit bced09cd1f

View File

@@ -74,9 +74,17 @@ Item {
block = true
colorButton.color = Qt.hsla(hue, saturation, lightness, alpha);
if (saturation > 0.0 && lightness > 0.0) {
hueSlider.value = hue
hueSlider2.value = hue
}
if (lightness > 0.0)
saturationSlider.value = saturation
else
saturation = saturationSlider.value
lightnessSlider.value = lightness
alphaSlider.value = alpha