[ui] GraphEditor: improve readOnly behavior on attributes

This commit is contained in:
Fabien Castan 2021-01-22 14:53:57 +01:00
parent 078120696a
commit e5ad4b2e64
2 changed files with 3 additions and 3 deletions

View file

@ -131,7 +131,7 @@ RowLayout {
MouseArea {
id: inputConnectMA
// If an input attribute is connected (isLink), we disable drag&drop
drag.target: attribute.isLink ? undefined : inputDragTarget
drag.target: (attribute.isLink || attribute.isReadOnly) ? undefined : inputDragTarget
drag.threshold: 0
enabled: !root.readOnly
anchors.fill: parent

View file

@ -325,7 +325,7 @@ Item {
property real globalX: root.x + nodeAttributes.x + inputs.x + inputLoader.x + inPin.x
property real globalY: root.y + nodeAttributes.y + inputs.y + inputLoader.y + inPin.y
readOnly: root.readOnly || root.isCompatibilityNode
readOnly: root.readOnly || object.isReadOnly
Component.onCompleted: attributePinCreated(attribute, inPin)
Component.onDestruction: attributePinDeleted(attribute, inPin)
onPressed: root.pressed(mouse)
@ -386,7 +386,7 @@ Item {
Behavior on height { PropertyAnimation {easing.type: Easing.Linear} }
visible: (height == childrenRect.height)
attribute: object
readOnly: root.readOnly
readOnly: root.readOnly || object.isReadOnly
Component.onCompleted: attributePinCreated(attribute, inPin)
Component.onDestruction: attributePinDeleted(attribute, inPin)
onPressed: root.pressed(mouse)