[GraphEditor] Internal Custom Color Picker disabled when node is locked

This commit is contained in:
Aurore LAFAURIE 2024-04-24 18:11:57 +02:00
parent 6791f02f2d
commit 1cdcc6dd78

View file

@ -289,6 +289,7 @@ RowLayout {
id: color_checkbox id: color_checkbox
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
checked: node && node.color === "" ? false : true checked: node && node.color === "" ? false : true
checkable: root.editable
text: "Custom Color" text: "Custom Color"
onClicked: { onClicked: {
if (checked) { if (checked) {
@ -302,9 +303,9 @@ RowLayout {
id: colorText id: colorText
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
implicitWidth: 100 implicitWidth: 100
enabled: color_checkbox.checked enabled: color_checkbox.checked && root.editable
visible: enabled visible: color_checkbox.checked
text: enabled ? attribute.value : "" text: color_checkbox.checked ? attribute.value : ""
selectByMouse: true selectByMouse: true
onEditingFinished: setTextFieldAttribute(text) onEditingFinished: setTextFieldAttribute(text)
onAccepted: setTextFieldAttribute(text) onAccepted: setTextFieldAttribute(text)
@ -322,6 +323,7 @@ RowLayout {
color: color_checkbox.checked ? attribute.value : "" color: color_checkbox.checked ? attribute.value : ""
MouseArea { MouseArea {
enabled: root.editable
anchors.fill: parent anchors.fill: parent
onClicked: colorDialog.open() onClicked: colorDialog.open()
} }