Skip to content

Commit

Permalink
[GraphEditor] Node: Display connected children when the parent is col…
Browse files Browse the repository at this point in the history
…lapsed

Just like any other connected attribute, any child attribute within a
Group that is either the source or destination of an edge needs to remain
on display, independently from the status of its parent (collapsed or
expanded).
  • Loading branch information
cbentejac committed Dec 13, 2024
1 parent 062a8b2 commit cc473d2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions meshroom/ui/qml/GraphEditor/Node.qml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ Item {
* it is reset.
*/
if (Boolean(attribute.enabled)) {
// If the parent's a GroupAttribute, use status of the parent's pin to determine visibility
// If the parent's a GroupAttribute, use status of the parent's pin to determine visibility UNLESS the
// child attribute is already connected
if (attribute.root && attribute.root.type === "GroupAttribute") {
var visible = Boolean(parentPins.get(attribute.root.name))
var visible = Boolean(parentPins.get(attribute.root.name) || attribute.hasOutputConnections || attribute.isLinkNested)
if (!visible && parentPins.has(attribute.name) && parentPins.get(attribute.name) === true) {
parentPins.set(attribute.name, false)
pin.expanded = false
Expand Down Expand Up @@ -455,7 +456,8 @@ Item {
visible: {
if (Boolean(modelData.enabled || modelData.hasOutputConnections)) {
if (modelData.root && modelData.root.type === "GroupAttribute") {
return Boolean(outputs.parentPins.get(modelData.root.name))
return Boolean(outputs.parentPins.get(modelData.root.name) ||
modelData.hasOutputConnections || modelData.isLinkNested)
}
return true
}
Expand Down Expand Up @@ -516,7 +518,8 @@ Item {
visible: {
if (Boolean(modelData.enabled)) {
if (modelData.root && modelData.root.type === "GroupAttribute") {
return Boolean(inputs.parentPins.get(modelData.root.name))
return Boolean(inputs.parentPins.get(modelData.root.name) ||
modelData.hasOutputConnections || modelData.isLinkNested)
}
return true
}
Expand Down Expand Up @@ -603,7 +606,8 @@ Item {
visible: {
if (Boolean(modelData.enabled || modelData.isLinkNested || modelData.hasOutputConnections)) {
if (modelData.root && modelData.root.type === "GroupAttribute") {
return Boolean(inputParams.parentPins.get(modelData.root.name))
return Boolean(inputParams.parentPins.get(modelData.root.name) ||
modelData.hasOutputConnections || modelData.isLinkNested)
}
return true
}
Expand Down

0 comments on commit cc473d2

Please sign in to comment.