Skip to content

Commit

Permalink
[ui] GraphEditor: Add a "preview" icon when the node's output can be …
Browse files Browse the repository at this point in the history
…loaded

If the node has been computed (i.e. its status is `SUCCESS`) and has at
least one output that can be loaded in the 2D viewer, then display an icon
with a tooltip that indicates that double-clicking the node allows to load
it and its outputs in the 2D Viewer.
  • Loading branch information
cbentejac committed Jun 6, 2023
1 parent 1b93ae7 commit 2324864
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions meshroom/ui/qml/GraphEditor/Node.qml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,36 @@ Item {
hoverEnabled: true
}
}

MaterialLabel {
id: nodeImageOutput
visible: node.hasImageOutput && ["SUCCESS"].includes(node.globalStatus) && node.chunks.count > 0
text: MaterialIcons.visibility
padding: 2
font.pointSize: 7

ToolTip {
id: nodeImageOutputTooltip
parent: header
visible: nodeImageOutputMA.containsMouse && nodeImageOutput.visible
text: "This node has at least one output that can be loaded in the 2D Viewer.\n" +
"Double-clicking on this node will load it in the 2D Viewer."
implicitWidth: 500
delay: 300

// Relative position for the tooltip to ensure we won't get stuck in a case where it starts appearing over the mouse's
// position because it's a bit long and cutting off the hovering of the mouse area (which leads to the tooltip beginning
// to appear and immediately disappearing, over and over again)
x: implicitWidth / 2.5
}

MouseArea {
// If the node header is hovered, comments may be displayed
id: nodeImageOutputMA
anchors.fill: parent
hoverEnabled: true
}
}
}
}
}
Expand Down

0 comments on commit 2324864

Please sign in to comment.