diff --git a/meshroom/ui/qml/GraphEditor/AttributePin.qml b/meshroom/ui/qml/GraphEditor/AttributePin.qml index f4cb3d8a59..76bf0c7dde 100755 --- a/meshroom/ui/qml/GraphEditor/AttributePin.qml +++ b/meshroom/ui/qml/GraphEditor/AttributePin.qml @@ -236,13 +236,24 @@ RowLayout { id: nameLabel anchors.rightMargin: 0 - anchors.right: root.attribute && root.attribute.isOutput ? parent.right : undefined labelIconRow.layoutDirection: root.attribute.isOutput ? Qt.RightToLeft : Qt.LeftToRight + anchors.right: root.attribute && root.attribute.isOutput ? parent.right : undefined labelIconRow.spacing: 0 + width: { + if (hovered) { + return icon.width + label.contentWidth + } else { + if (nameContainer.width > 0 && icon.width + label.contentWidth < nameContainer.width) + return icon.width + label.contentWidth + return nameContainer.width + } + } enabled: !root.readOnly visible: true - property bool hovered: (inputConnectMA.containsMouse || inputConnectMA.drag.active || + property bool parentNotReady: nameContainer.width == 0 + property bool hovered: parentNotReady || + (inputConnectMA.containsMouse || inputConnectMA.drag.active || inputDropArea.containsDrag || outputConnectMA.containsMouse || outputConnectMA.drag.active || outputDropArea.containsDrag) @@ -259,6 +270,7 @@ RowLayout { // Text label.text: root.attribute.label label.font.pointSize: 7 + labelWidth: hovered ? label.contentWidth : nameLabel.width - icon.width label.elide: hovered ? Text.ElideNone : Text.ElideMiddle label.horizontalAlignment: root.attribute && root.attribute.isOutput ? Text.AlignRight : Text.AlignLeft