Meshroom/meshroom/ui/qml/GraphEditor/AttributeEditor.qml
Yann Lanthony b5c985b3fb [ui] GraphEditor: solo 3D media with Double Click + Control modifier
* allow to solo a 3D media from the GraphEditor by double clicking on a node or an attribute with the Control modifier pressed
* consistent with Viewer3D.MediaLibrary behavior (solo on Ctrl+Click on visibility button)
* handle supported file extensions in Viewer3DSettings
2019-01-07 16:19:42 +01:00

56 lines
1.3 KiB
QML

import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import MaterialIcons 2.2
import Utils 1.0
/**
* A component to display and edit the attributes of a Node.
*/
ListView {
id: root
property variant attributes: null
property bool readOnly: false
property int labelWidth: 180
signal upgradeRequest()
signal attributeDoubleClicked(var mouse, var attribute)
implicitHeight: contentHeight
clip: true
spacing: 2
ScrollBar.vertical: ScrollBar { id: scrollBar }
model: SortFilterDelegateModel {
model: attributes
filterRole: GraphEditorSettings.showAdvancedAttributes ? "" : "advanced"
filterValue: false
function modelData(item, roleName) {
return item.model.object.desc[roleName]
}
Component {
id: delegateComponent
AttributeItemDelegate {
width: ListView.view.width - scrollBar.width
readOnly: root.readOnly
labelWidth: root.labelWidth
attribute: object
onDoubleClicked: root.attributeDoubleClicked(mouse, attr)
}
}
}
// Helper MouseArea to lose edit/activeFocus
// when clicking on the background
MouseArea {
anchors.fill: parent
onClicked: root.forceActiveFocus()
z: -1
}
}