forked from qt-creator/qt-creator
QmlDesigner: Fix ColorEditor gradient controls
Fix ColorEditor gradient controls not updating their value on changing the gradient or selecting another item containing a gradient. Task-number: QDS-5183 Change-Id: Icbec41f8db90f1e9c4ff0f3564ad6ed1df667f0f Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
969d659713
commit
502afc754b
@@ -1075,6 +1075,20 @@ SecondColumnLayout {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: ceMode
|
||||||
|
function onActivated() {
|
||||||
|
spinBox.readValue()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: modelNodeBackend
|
||||||
|
function onSelectionChanged() {
|
||||||
|
spinBox.readValue()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GradientPropertySpinBox {
|
GradientPropertySpinBox {
|
||||||
id: spinBox
|
id: spinBox
|
||||||
implicitWidth: StudioTheme.Values.controlGap
|
implicitWidth: StudioTheme.Values.controlGap
|
||||||
|
@@ -45,6 +45,10 @@ Item {
|
|||||||
|
|
||||||
onFocusChanged: restoreCursor()
|
onFocusChanged: restoreCursor()
|
||||||
|
|
||||||
|
function readValue() {
|
||||||
|
spinBox.realValue = gradientLine.model.readGradientProperty(wrapper.propertyName)
|
||||||
|
}
|
||||||
|
|
||||||
StudioControls.RealSpinBox {
|
StudioControls.RealSpinBox {
|
||||||
id: spinBox
|
id: spinBox
|
||||||
|
|
||||||
@@ -56,9 +60,7 @@ Item {
|
|||||||
realStepSize: 1
|
realStepSize: 1
|
||||||
decimals: 0
|
decimals: 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: wrapper.readValue()
|
||||||
spinBox.realValue = gradientLine.model.readGradientProperty(wrapper.propertyName)
|
|
||||||
}
|
|
||||||
onCompressedRealValueModified: {
|
onCompressedRealValueModified: {
|
||||||
gradientLine.model.setGradientProperty(wrapper.propertyName, spinBox.realValue)
|
gradientLine.model.setGradientProperty(wrapper.propertyName, spinBox.realValue)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user