diff options
author | Loïc Vital <mugulmotion@gmail.com> | 2022-10-07 18:43:28 +0300 |
---|---|---|
committer | Fabien Castan <fabcastan@gmail.com> | 2022-10-19 11:50:23 +0300 |
commit | 0496f0c6a2be12e2aca8d63ae76ffa35a9e0e32d (patch) | |
tree | 09559c19a634086a3e2701e2488f888350646098 | |
parent | 18b5f4bb2194777fc25517866996d2972e43b5f7 (diff) |
[ui] button to clear node from 2d viewer
-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 { |