[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:
Yann Lanthony 2018-12-14 16:02:04 +01:00
parent b6e4876494
commit 00feb46667
5 changed files with 245 additions and 232 deletions

View file

@ -348,37 +348,17 @@ RowLayout {
Component {
id: groupAttribute_component
ListView {
id: chilrenListView
implicitWidth: parent.width
implicitHeight: childrenRect.height
onCountChanged: forceLayout()
spacing: 2
model: SortFilterDelegateModel {
model: attribute.value
filterRole: GraphEditorSettings.showAdvancedAttributes ? "" : "advanced"
filterValue: false
function modelData(item, roleName) {
return item.model.object.desc[roleName]
}
delegate: RowLayout {
id: row
width: chilrenListView.width
property var childAttrib: object
Component.onCompleted: {
var cpt = Qt.createComponent("AttributeItemDelegate.qml")
var obj = cpt.createObject(row,
{'attribute': Qt.binding(function() { return row.childAttrib }),
'readOnly': Qt.binding(function() { return root.readOnly })
})
obj.Layout.fillWidth = true
obj.labelWidth = 100 // reduce label width for children (space gain)
obj.doubleClicked.connect(function(attr) {root.doubleClicked(attr)})
}
}
ColumnLayout {
id: groupItem
Component.onCompleted: {
var cpt = Qt.createComponent("AttributeEditor.qml");
var obj = cpt.createObject(groupItem,
{'attributes': Qt.binding(function() { return attribute.value }),
'readOnly': Qt.binding(function() { return root.readOnly }),
'labelWidth': 100, // reduce label width for children (space gain)
})
obj.Layout.fillWidth = true;
obj.attributeDoubleClicked.connect(function(attr) {root.doubleClicked(attr)})
}
}
}