From f2767aec33589eb225b3d8baf1e8e2bc3baa423e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 27 Apr 2023 17:38:35 +0200 Subject: [PATCH] [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. --- meshroom/ui/qml/GraphEditor/Node.qml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index e0f7fc33..955a6d8e 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -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 + } + } } } }