Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2cc458a

Browse files
committedDec 31, 2024·
[GraphEditor] AttributePin: Handle width and elide for attributes' name
1 parent bcd5aa4 commit 2cc458a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

‎meshroom/ui/qml/GraphEditor/AttributePin.qml

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

238+
property bool hovered: (inputConnectMA.hoverEnabled || outputConnectMA.hoverEnabled) &&
239+
(inputConnectMA.containsMouse || inputConnectMA.drag.active ||
240+
inputDropArea.containsDrag || outputConnectMA.containsMouse ||
241+
outputConnectMA.drag.active || outputDropArea.containsDrag)
242+
243+
width: hovered ? icon.contentWidth + label.contentWidth : parent.width
238244
anchors.rightMargin: 0
239245
anchors.right: root.attribute && root.attribute.isOutput ? parent.right : undefined
240246
labelIconRow.layoutDirection: root.attribute.isOutput ? Qt.RightToLeft : Qt.LeftToRight
241247
labelIconRow.spacing: 0
242248

243249
enabled: !root.readOnly
244-
visible: true
245-
property bool hovered: (inputConnectMA.containsMouse || inputConnectMA.drag.active ||
246-
inputDropArea.containsDrag || outputConnectMA.containsMouse ||
247-
outputConnectMA.drag.active || outputDropArea.containsDrag)
248250

249251
labelIconColor: {
250252
if ((root.attribute.hasOutputConnections || root.attribute.isLink) && !root.attribute.enabled) {
@@ -259,6 +261,7 @@ RowLayout {
259261
// Text
260262
label.text: root.attribute.label
261263
label.font.pointSize: 7
264+
labelWidth: hovered ? label.contentWidth : nameLabel.width
262265
label.elide: hovered ? Text.ElideNone : Text.ElideMiddle
263266
label.horizontalAlignment: root.attribute && root.attribute.isOutput ? Text.AlignRight : Text.AlignLeft
264267

0 commit comments

Comments
 (0)
Please sign in to comment.