mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-29 00:46:32 +02:00
[ui] extract NodeEditor from AttributeEditor
* NodeEditor * exposes Node parameters: compatibility, attributes and logs * provides a placeholder when no active Node * AttributeEditor * only displays the list of Attributes * use 'AttributeEditor' for GroupAttributes in AttributeItemDelegate * Layout * move NodeEditor on the same SplitView level as GraphEditor * move current node name and menu to the Panel's header
This commit is contained in:
parent
b6e4876494
commit
00feb46667
5 changed files with 245 additions and 232 deletions
155
meshroom/ui/qml/GraphEditor/NodeEditor.qml
Normal file
155
meshroom/ui/qml/GraphEditor/NodeEditor.qml
Normal file
|
@ -0,0 +1,155 @@
|
|||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Layouts 1.3
|
||||
import MaterialIcons 2.2
|
||||
import Controls 1.0
|
||||
|
||||
|
||||
/**
|
||||
* NodeEditor allows to visualize and edit the parameters of a Node.
|
||||
* It mainly provides an attribute editor and a log inspector.
|
||||
*/
|
||||
Panel {
|
||||
id: root
|
||||
|
||||
property variant node
|
||||
property bool readOnly: false
|
||||
property bool isCompatibilityNode: node && node.compatibilityIssue !== undefined
|
||||
|
||||
signal attributeDoubleClicked(var attribute)
|
||||
signal upgradeRequest()
|
||||
|
||||
title: "Node" + (node !== null ? " - <b>" + node.label + "</b>" : "")
|
||||
icon: MaterialLabel { text: MaterialIcons.tune }
|
||||
|
||||
headerBar: RowLayout {
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.more_vert
|
||||
font.pointSize: 11
|
||||
padding: 2
|
||||
onClicked: settingsMenu.open()
|
||||
checkable: true
|
||||
checked: settingsMenu.visible
|
||||
Menu {
|
||||
id: settingsMenu
|
||||
y: parent.height
|
||||
MenuItem {
|
||||
id: advancedToggle
|
||||
text: "Advanced Attributes"
|
||||
MaterialLabel {
|
||||
anchors.right: parent.right; anchors.rightMargin: parent.padding;
|
||||
text: MaterialIcons.build
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pointSize: 8
|
||||
}
|
||||
checkable: true
|
||||
checked: GraphEditorSettings.showAdvancedAttributes
|
||||
onClicked: GraphEditorSettings.showAdvancedAttributes = !GraphEditorSettings.showAdvancedAttributes
|
||||
}
|
||||
MenuItem {
|
||||
text: "Open Cache Folder"
|
||||
enabled: root.node !== null
|
||||
onClicked: Qt.openUrlExternally(Filepath.stringToUrl(root.node.internalFolder))
|
||||
}
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
enabled: root.node !== null
|
||||
text: "Clear Submitted Status"
|
||||
onClicked: node.clearSubmittedChunks()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
// CompatibilityBadge banner for CompatibilityNode
|
||||
Loader {
|
||||
active: root.isCompatibilityNode
|
||||
Layout.fillWidth: true
|
||||
visible: active // for layout update
|
||||
|
||||
sourceComponent: CompatibilityBadge {
|
||||
canUpgrade: root.node.canUpgrade
|
||||
issueDetails: root.node.issueDetails
|
||||
onUpgradeRequest: root.upgradeRequest()
|
||||
sourceComponent: bannerDelegate
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
sourceComponent: root.node ? editor_component : placeholder_component
|
||||
|
||||
Component {
|
||||
id: placeholder_component
|
||||
|
||||
Item {
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
MaterialLabel {
|
||||
text: MaterialIcons.select_all
|
||||
font.pointSize: 34
|
||||
color: Qt.lighter(palette.mid, 1.2)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
Label {
|
||||
color: Qt.lighter(palette.mid, 1.2)
|
||||
text: "Select a Node to edit its Attributes"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: editor_component
|
||||
|
||||
ColumnLayout {
|
||||
StackLayout {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
AttributeEditor {
|
||||
Layout.fillWidth: true
|
||||
attributes: root.node.attributes
|
||||
readOnly: root.isCompatibilityNode
|
||||
onAttributeDoubleClicked: root.attributeDoubleClicked(attribute)
|
||||
onUpgradeRequest: root.upgradeRequest()
|
||||
}
|
||||
|
||||
NodeLog {
|
||||
id: nodeLog
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
node: root.node
|
||||
}
|
||||
}
|
||||
TabBar {
|
||||
id: tabBar
|
||||
|
||||
Layout.fillWidth: true
|
||||
width: childrenRect.width
|
||||
position: TabBar.Footer
|
||||
TabButton {
|
||||
text: "Attributes"
|
||||
width: implicitWidth
|
||||
padding: 4
|
||||
leftPadding: 8
|
||||
rightPadding: leftPadding
|
||||
}
|
||||
TabButton {
|
||||
text: "Log"
|
||||
width: implicitWidth
|
||||
leftPadding: 8
|
||||
rightPadding: leftPadding
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue