forked from qt-creator/qt-creator
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:
committed by
Thomas Hartmann
parent
a5e2b4b149
commit
bced09cd1f
@@ -74,9 +74,17 @@ Item {
|
|||||||
block = true
|
block = true
|
||||||
|
|
||||||
colorButton.color = Qt.hsla(hue, saturation, lightness, alpha);
|
colorButton.color = Qt.hsla(hue, saturation, lightness, alpha);
|
||||||
hueSlider.value = hue
|
|
||||||
hueSlider2.value = hue
|
if (saturation > 0.0 && lightness > 0.0) {
|
||||||
saturationSlider.value = saturation
|
hueSlider.value = hue
|
||||||
|
hueSlider2.value = hue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lightness > 0.0)
|
||||||
|
saturationSlider.value = saturation
|
||||||
|
else
|
||||||
|
saturation = saturationSlider.value
|
||||||
|
|
||||||
lightnessSlider.value = lightness
|
lightnessSlider.value = lightness
|
||||||
alphaSlider.value = alpha
|
alphaSlider.value = alpha
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user