File tree 1 file changed +16
-2
lines changed
meshroom/ui/qml/GraphEditor
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -236,13 +236,26 @@ RowLayout {
236
236
id: nameLabel
237
237
238
238
anchors .rightMargin : 0
239
- anchors .right : root .attribute && root .attribute .isOutput ? parent .right : undefined
240
239
labelIconRow .layoutDirection : root .attribute .isOutput ? Qt .RightToLeft : Qt .LeftToRight
240
+ anchors .right : root .attribute && root .attribute .isOutput ? parent .right : undefined
241
241
labelIconRow .spacing : 0
242
+ width: {
243
+ if (hovered) {
244
+ return icon .width + label .contentWidth
245
+ } else {
246
+ if (nameContainer .width > 0 && icon .width + label .contentWidth < nameContainer .width )
247
+ return icon .width + label .contentWidth
248
+ return nameContainer .width
249
+ }
250
+ }
242
251
243
252
enabled: ! root .readOnly
244
253
visible: true
245
- property bool hovered: (inputConnectMA .containsMouse || inputConnectMA .drag .active ||
254
+ property bool parentNotReady: nameContainer .width == 0 // Allows to trigger a change of state once the parent is ready,
255
+ // ensuring the correct width of the elements upon their first
256
+ // display without waiting for a mouse interaction
257
+ property bool hovered: parentNotReady ||
258
+ (inputConnectMA .containsMouse || inputConnectMA .drag .active ||
246
259
inputDropArea .containsDrag || outputConnectMA .containsMouse ||
247
260
outputConnectMA .drag .active || outputDropArea .containsDrag )
248
261
@@ -259,6 +272,7 @@ RowLayout {
259
272
// Text
260
273
label .text : root .attribute .label
261
274
label .font .pointSize : 7
275
+ labelWidth: hovered ? label .contentWidth : nameLabel .width - icon .width
262
276
label .elide : hovered ? Text .ElideNone : Text .ElideMiddle
263
277
label .horizontalAlignment : root .attribute && root .attribute .isOutput ? Text .AlignRight : Text .AlignLeft
264
278
You can’t perform that action at this time.
0 commit comments