[ui] InputNode behavior for menu and display

This commit is contained in:
Aurore LAFAURIE 2024-04-09 16:30:19 +02:00 committed by Fabien Castan
parent 82dc3fb294
commit 671b3ff128
4 changed files with 24 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -175,7 +175,7 @@ FocusScope {
}
// node must be computed or at least running
if (!node.isPartiallyFinished()) {
if (node.isComputable && !node.isPartiallyFinished()) {
return false
}