Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alicevision/meshroom.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Vital <mugulmotion@gmail.com>2022-10-07 18:43:28 +0300
committerFabien Castan <fabcastan@gmail.com>2022-10-19 11:50:23 +0300
commit0496f0c6a2be12e2aca8d63ae76ffa35a9e0e32d (patch)
tree09559c19a634086a3e2701e2488f888350646098
parent18b5f4bb2194777fc25517866996d2972e43b5f7 (diff)
[ui] button to clear node from 2d viewer
-rw-r--r--meshroom/ui/qml/Viewer/Viewer2D.qml19
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 {