Skip to content

Commit 448bbf3

Browse files
committed
[GraphEditor] AttributePin: Handle width and elide for attributes' name
1 parent e040b81 commit 448bbf3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

meshroom/ui/qml/GraphEditor/AttributePin.qml

+7-3
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,19 @@ RowLayout {
235235
MaterialToolLabel {
236236
id: nameLabel
237237

238+
width: hovered ? contentWidth : parent.width
238239
anchors.rightMargin: 0
239240
anchors.right: root.attribute && root.attribute.isOutput ? parent.right : undefined
240241
labelIconRow.layoutDirection: root.attribute.isOutput ? Qt.RightToLeft : Qt.LeftToRight
241242
labelIconRow.spacing: 0
242243

243244
enabled: !root.readOnly
244245
visible: true
245-
property bool hovered: (inputConnectMA.containsMouse || inputConnectMA.drag.active ||
246-
inputDropArea.containsDrag || outputConnectMA.containsMouse ||
247-
outputConnectMA.drag.active || outputDropArea.containsDrag)
246+
property bool hovered: parent.width == 0 || ((inputConnectMA.hoverEnabled || outputConnectMA.hoverEnabled) &&
247+
((inputConnectMA.containsMouse || inputConnectMA.drag.active ||
248+
inputDropArea.containsDrag || outputConnectMA.containsMouse ||
249+
outputConnectMA.drag.active || outputDropArea.containsDrag)))
250+
248251

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

265269
// Icon

0 commit comments

Comments
 (0)