QmlDesigner: Fix reflection in ColorEditor

Change-Id: I0d4cced42dd2b1d98f46c9870ca206e83b3aa4db
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2023-01-11 11:12:50 +01:00
committed by Henning Gründl
parent 4a897e0395
commit 6fba34f5a7

View File

@@ -38,12 +38,21 @@ SecondColumnLayout {
property alias spacer: spacer
property bool __block: false
function resetShapeColor() {
colorEditor.backendValue.resetValue()
}
function initEditor() {
colorEditor.syncColor()
}
// Syncing color from backend to frontend and block reflection
function syncColor() {
colorEditor.__block = true
colorEditor.color = colorEditor.value
colorEditor.__block = false
}
Connections {
@@ -52,12 +61,12 @@ SecondColumnLayout {
function onValueChanged() {
if (popupLoader.isNotInGradientMode())
colorEditor.color = colorEditor.value
colorEditor.syncColor()
}
function onBackendValueChanged() {
if (popupLoader.isNotInGradientMode())
colorEditor.color = colorEditor.value
colorEditor.syncColor()
}
}
@@ -83,6 +92,9 @@ SecondColumnLayout {
}
onColorChanged: {
if (colorEditor.__block)
return
if (!popupLoader.isInValidState)
return
@@ -211,7 +223,7 @@ SecondColumnLayout {
if (popupLoader.active && popupLoader.dialog)
popupLoader.dialog.determineActiveColorMode()
else
colorEditor.color = colorEditor.value
colorEditor.syncColor()
}
property alias active: popupLoader.loader.active