forked from qt-creator/qt-creator
QmlDesigner: Update the value of the color picker for CollectionEditor
Fixes: QDS-11796 Change-Id: Iaf3f6bc06771f461c4119d55ae3c3a294d3d8564 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -42,6 +42,19 @@ Row {
|
|||||||
|
|
||||||
property bool __block: false
|
property bool __block: false
|
||||||
|
|
||||||
|
function getColorFromEditValue() {
|
||||||
|
if (!edit)
|
||||||
|
return "white" // default color for Rectangle
|
||||||
|
|
||||||
|
if (colorEditor.isVector3D) {
|
||||||
|
return Qt.rgba(__editColor.x,
|
||||||
|
__editColor.y,
|
||||||
|
__editColor.z, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
return __editColor
|
||||||
|
}
|
||||||
|
|
||||||
function resetShapeColor() {
|
function resetShapeColor() {
|
||||||
if (edit)
|
if (edit)
|
||||||
edit = ""
|
edit = ""
|
||||||
@@ -64,7 +77,7 @@ Row {
|
|||||||
// Syncing color from backend to frontend and block reflection
|
// Syncing color from backend to frontend and block reflection
|
||||||
function syncColor() {
|
function syncColor() {
|
||||||
colorEditor.__block = true
|
colorEditor.__block = true
|
||||||
colorEditor.color = colorEditor.value
|
colorEditor.color = colorEditor.getColorFromEditValue()
|
||||||
hexTextField.syncColor()
|
hexTextField.syncColor()
|
||||||
colorEditor.__block = false
|
colorEditor.__block = false
|
||||||
}
|
}
|
||||||
@@ -201,10 +214,10 @@ Row {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isSolid() {
|
function isSolid() {
|
||||||
if (!loader.active)
|
if (!loader.active)
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return popupDialog.loaderItem.isSolid()
|
return popupDialog.loaderItem.isSolid()
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLinearGradient(){
|
function isLinearGradient(){
|
||||||
@@ -221,6 +234,7 @@ Row {
|
|||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
popupDialog.ensureLoader()
|
popupDialog.ensureLoader()
|
||||||
|
popupDialog.loaderItem.initEditor()
|
||||||
popupDialog.show(preview)
|
popupDialog.show(preview)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user