mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-02 19:02:29 +02:00
[ui] GraphEditor: Add a "preview" icon when the node's output can be 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.
This commit is contained in:
parent
36609bfc3b
commit
f2767aec33
1 changed files with 30 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue