mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-31 07:18:25 +02:00
[ui] GraphEditor: show/hide advanced Attributes
* use SortFilterModels to filter out advanced attributes when hidden * add GraphEditorSettings with persistent settings related to the GraphEditor
This commit is contained in:
parent
168b573e36
commit
1c935b6b5a
4 changed files with 60 additions and 24 deletions
|
@ -46,6 +46,11 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
Menu {
|
Menu {
|
||||||
id: settingsMenu
|
id: settingsMenu
|
||||||
|
MenuItem {
|
||||||
|
text: "Advanced Attributes"
|
||||||
|
checked: GraphEditorSettings.showAdvancedAttributes
|
||||||
|
onClicked: GraphEditorSettings.showAdvancedAttributes = !GraphEditorSettings.showAdvancedAttributes
|
||||||
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: "Open Cache Folder"
|
text: "Open Cache Folder"
|
||||||
onClicked: Qt.openUrlExternally(Filepath.stringToUrl(node.internalFolder))
|
onClicked: Qt.openUrlExternally(Filepath.stringToUrl(node.internalFolder))
|
||||||
|
@ -87,21 +92,32 @@ ColumnLayout {
|
||||||
id: attributesListView
|
id: attributesListView
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 4
|
anchors.margins: 2
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 1
|
spacing: 2
|
||||||
ScrollBar.vertical: ScrollBar { id: scrollBar }
|
ScrollBar.vertical: ScrollBar { id: scrollBar }
|
||||||
|
|
||||||
model: node ? node.attributes : undefined
|
model: SortFilterDelegateModel {
|
||||||
|
|
||||||
delegate: AttributeItemDelegate {
|
model: node ? node.attributes : null
|
||||||
|
filterRole: GraphEditorSettings.showAdvancedAttributes ? "" : "advanced"
|
||||||
|
filterValue: false
|
||||||
|
function modelData(item, roleName) {
|
||||||
|
return item.model.object.desc[roleName]
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: delegateComponent
|
||||||
|
AttributeItemDelegate {
|
||||||
|
width: attributesListView.width - scrollBar.width
|
||||||
readOnly: root.isCompatibilityNode
|
readOnly: root.isCompatibilityNode
|
||||||
labelWidth: 180
|
labelWidth: 180
|
||||||
width: attributesListView.width
|
|
||||||
attribute: object
|
attribute: object
|
||||||
onDoubleClicked: root.attributeDoubleClicked(attr)
|
onDoubleClicked: root.attributeDoubleClicked(attr)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Helper MouseArea to lose edit/activeFocus
|
// Helper MouseArea to lose edit/activeFocus
|
||||||
// when clicking on the background
|
// when clicking on the background
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
@ -331,11 +331,18 @@ RowLayout {
|
||||||
id: groupAttribute_component
|
id: groupAttribute_component
|
||||||
ListView {
|
ListView {
|
||||||
id: chilrenListView
|
id: chilrenListView
|
||||||
model: attribute.value
|
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: childrenRect.height
|
implicitHeight: childrenRect.height
|
||||||
onCountChanged: forceLayout()
|
onCountChanged: forceLayout()
|
||||||
spacing: 2
|
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 {
|
delegate: RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
@ -356,4 +363,5 @@ RowLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
11
meshroom/ui/qml/GraphEditor/GraphEditorSettings.qml
Normal file
11
meshroom/ui/qml/GraphEditor/GraphEditorSettings.qml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
pragma Singleton
|
||||||
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Persistent Settings related to the GraphEditor module.
|
||||||
|
*/
|
||||||
|
Settings {
|
||||||
|
category: 'GraphEditor'
|
||||||
|
property bool showAdvancedAttributes: false
|
||||||
|
}
|
|
@ -9,3 +9,4 @@ AttributeEditor 1.0 AttributeEditor.qml
|
||||||
AttributeItemDelegate 1.0 AttributeItemDelegate.qml
|
AttributeItemDelegate 1.0 AttributeItemDelegate.qml
|
||||||
CompatibilityBadge 1.0 CompatibilityBadge.qml
|
CompatibilityBadge 1.0 CompatibilityBadge.qml
|
||||||
CompatibilityManager 1.0 CompatibilityManager.qml
|
CompatibilityManager 1.0 CompatibilityManager.qml
|
||||||
|
singleton GraphEditorSettings 1.0 GraphEditorSettings.qml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue