aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAli Kianian <ali.kianian@qt.io>2024-02-12 18:45:05 +0200
committerAli Kianian <ali.kianian@qt.io>2024-02-13 07:14:17 +0000
commit4c4e90062c071005d8dd5aaab09a952054301ffc (patch)
tree62969b0c2a51009a8c48224da07f058df05167b3
parente66b19d4c4ac591bddfaee26b7ad283690cb9149 (diff)
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>
-rw-r--r--share/qtcreator/qmldesigner/collectionEditorQmlSource/ColorViewDelegate.qml22
1 files changed, 18 insertions, 4 deletions
diff --git a/share/qtcreator/qmldesigner/collectionEditorQmlSource/ColorViewDelegate.qml b/share/qtcreator/qmldesigner/collectionEditorQmlSource/ColorViewDelegate.qml
index 1414a2dd3a..6bb1b60159 100644
--- a/share/qtcreator/qmldesigner/collectionEditorQmlSource/ColorViewDelegate.qml
+++ b/share/qtcreator/qmldesigner/collectionEditorQmlSource/ColorViewDelegate.qml
@@ -42,6 +42,19 @@ Row {
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() {
if (edit)
edit = ""
@@ -64,7 +77,7 @@ Row {
// Syncing color from backend to frontend and block reflection
function syncColor() {
colorEditor.__block = true
- colorEditor.color = colorEditor.value
+ colorEditor.color = colorEditor.getColorFromEditValue()
hexTextField.syncColor()
colorEditor.__block = false
}
@@ -201,10 +214,10 @@ Row {
}
function isSolid() {
- if (!loader.active)
- return true
+ if (!loader.active)
+ return true
- return popupDialog.loaderItem.isSolid()
+ return popupDialog.loaderItem.isSolid()
}
function isLinearGradient(){
@@ -221,6 +234,7 @@ Row {
function open() {
popupDialog.ensureLoader()
+ popupDialog.loaderItem.initEditor()
popupDialog.show(preview)
}