diff options
Diffstat (limited to 'meshroom/ui/qml/Viewer/Viewer2D.qml')
-rw-r--r-- | meshroom/ui/qml/Viewer/Viewer2D.qml | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 4032e106..6f1db582 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -192,7 +192,6 @@ FocusScope { useExternal = true; sourceExternal = path; displayedNode = null; - metadata = {}; } function getImageFile() { @@ -254,8 +253,13 @@ FocusScope { } onDisplayedNodeChanged: { + // clear metadata if no displayed node + if (!displayedNode) { + metadata = {}; + } + + // update output attribute names var names = []; - // safety check if (displayedNode) { // store attr name for output attributes that represent images for (var i = 0; i < displayedNode.attributes.count; i++) { @@ -626,6 +630,17 @@ FocusScope { Layout.preferredWidth: contentWidth height: contentHeight } + + // button to clear currently displayed node + MaterialToolButton { + id: clearDisplayedNode + text: MaterialIcons.close + ToolTip.text: "Clear node" + enabled: root.displayedNode + onClicked: { + root.displayedNode = null + } + } } } Item { |