Skip to content

Commit

Permalink
[GraphEditor] AttributePin: Handle width and elide for attributes' name
Browse files Browse the repository at this point in the history
  • Loading branch information
cbentejac committed Dec 30, 2024
1 parent e040b81 commit 448bbf3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions meshroom/ui/qml/GraphEditor/AttributePin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,19 @@ RowLayout {
MaterialToolLabel {
id: nameLabel

width: hovered ? contentWidth : parent.width
anchors.rightMargin: 0
anchors.right: root.attribute && root.attribute.isOutput ? parent.right : undefined
labelIconRow.layoutDirection: root.attribute.isOutput ? Qt.RightToLeft : Qt.LeftToRight
labelIconRow.spacing: 0

enabled: !root.readOnly
visible: true
property bool hovered: (inputConnectMA.containsMouse || inputConnectMA.drag.active ||
inputDropArea.containsDrag || outputConnectMA.containsMouse ||
outputConnectMA.drag.active || outputDropArea.containsDrag)
property bool hovered: parent.width == 0 || ((inputConnectMA.hoverEnabled || outputConnectMA.hoverEnabled) &&
((inputConnectMA.containsMouse || inputConnectMA.drag.active ||
inputDropArea.containsDrag || outputConnectMA.containsMouse ||
outputConnectMA.drag.active || outputDropArea.containsDrag)))


labelIconColor: {
if ((root.attribute.hasOutputConnections || root.attribute.isLink) && !root.attribute.enabled) {
Expand All @@ -260,6 +263,7 @@ RowLayout {
label.text: root.attribute.label
label.font.pointSize: 7
label.elide: hovered ? Text.ElideNone : Text.ElideMiddle
label.width: hovered ? contentWidth : parent.width
label.horizontalAlignment: root.attribute && root.attribute.isOutput ? Text.AlignRight : Text.AlignLeft

// Icon
Expand Down

0 comments on commit 448bbf3

Please sign in to comment.