From 671b3ff128bb3ba4284a42da69a3c7dc670cc0f0 Mon Sep 17 00:00:00 2001 From: Aurore LAFAURIE Date: Tue, 9 Apr 2024 16:30:19 +0200 Subject: [PATCH] [ui] InputNode behavior for menu and display --- meshroom/ui/qml/GraphEditor/GraphEditor.qml | 16 +++++++++++++--- meshroom/ui/qml/GraphEditor/Node.qml | 5 +++-- meshroom/ui/qml/GraphEditor/NodeEditor.qml | 7 +++++++ meshroom/ui/qml/Viewer/Viewer2D.qml | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 2a9df410..cca1829d 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -448,6 +448,8 @@ Item { MenuItem { text: "Compute" + visible: nodeMenu.currentNode ? nodeMenu.currentNode.isComputable : false + height: visible ? implicitHeight : 0 enabled: nodeMenu.canComputeNode && (nodeMenu.canSubmitOrCompute%2 == 1) //canSubmit if canSubmitOrCompute == 1(can compute) or 3(can compute & submit) onTriggered: { computeRequest(nodeMenu.currentNode) @@ -456,7 +458,7 @@ Item { MenuItem { text: "Submit" enabled: nodeMenu.canComputeNode && nodeMenu.canSubmitOrCompute > 1 - visible: uigraph ? uigraph.canSubmit : false + visible: nodeMenu.currentNode ? nodeMenu.currentNode.isComputable : uigraph ? uigraph.canSubmit : false height: visible ? implicitHeight : 0 onTriggered: submitRequest(nodeMenu.currentNode) } @@ -476,9 +478,13 @@ Item { } MenuItem { text: "Open Folder" + visible: nodeMenu.currentNode ? nodeMenu.currentNode.isComputable : false + height: visible ? implicitHeight : 0 onTriggered: Qt.openUrlExternally(Filepath.stringToUrl(nodeMenu.currentNode.internalFolder)) } - MenuSeparator {} + MenuSeparator { + visible: nodeMenu.currentNode ? nodeMenu.currentNode.isComputable : false + } MenuItem { text: "Cut Node(s)" enabled: true @@ -542,9 +548,13 @@ Item { } } } - MenuSeparator {} + MenuSeparator { + visible: nodeMenu.currentNode ? nodeMenu.currentNode.isComputable : false + } MenuItem { text: "Delete Data" + (deleteFollowingButton.hovered ? " From Here" : "" ) + "..." + visible: nodeMenu.currentNode ? nodeMenu.currentNode.isComputable : false + height: visible ? implicitHeight : 0 enabled: { if (!nodeMenu.currentNode) return false diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index 917fca2b..d9638d51 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -28,7 +28,7 @@ Item { property point position: Qt.point(x, y) /// Styling property color shadowColor: "#cc000000" - readonly property color defaultColor: isCompatibilityNode ? "#444" : activePalette.base + readonly property color defaultColor: isCompatibilityNode ? "#444" : !node.isComputable ? "#BA3D69" : activePalette.base property color baseColor: defaultColor property point mousePosition: Qt.point(mouseArea.mouseX, mouseArea.mouseY) @@ -328,7 +328,7 @@ Item { MaterialLabel { id: nodeImageOutput visible: (node.hasImageOutput || node.has3DOutput) - && ["SUCCESS"].includes(node.globalStatus) && node.chunks.count > 0 + && ((["SUCCESS"].includes(node.globalStatus) && node.chunks.count > 0) || !node.isComputable) text: MaterialIcons.visibility padding: 2 font.pointSize: 7 @@ -367,6 +367,7 @@ Item { // Node Chunks NodeChunks { + visible: node.isComputable defaultColor: Colors.sysPalette.mid implicitHeight: 3 width: parent.width diff --git a/meshroom/ui/qml/GraphEditor/NodeEditor.qml b/meshroom/ui/qml/GraphEditor/NodeEditor.qml index b89a36f0..c0b9628a 100644 --- a/meshroom/ui/qml/GraphEditor/NodeEditor.qml +++ b/meshroom/ui/qml/GraphEditor/NodeEditor.qml @@ -335,6 +335,7 @@ Panel { TabBar { id: tabBar + visible: root.node !== null Layout.fillWidth: true width: childrenRect.width @@ -347,16 +348,22 @@ Panel { rightPadding: leftPadding } TabButton { + visible: node != null && node.isComputable + width: !visible ? 0 : tabBar.width / tabBar.count text: "Log" leftPadding: 8 rightPadding: leftPadding } TabButton { + visible: node != null && node.isComputable + width: !visible ? 0 : tabBar.width / tabBar.count text: "Statistics" leftPadding: 8 rightPadding: leftPadding } TabButton { + visible: node != null && node.isComputable + width: !visible ? 0 : tabBar.width / tabBar.count text: "Status" leftPadding: 8 rightPadding: leftPadding diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 4faf49ab..3f722bb0 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -175,7 +175,7 @@ FocusScope { } // node must be computed or at least running - if (!node.isPartiallyFinished()) { + if (node.isComputable && !node.isPartiallyFinished()) { return false }