Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 55 additions & 4 deletions meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RowLayout {
}

Pane {
visible: attribute.type !== "GroupAttribute"
background: Rectangle {
id: background
color: object != undefined && object.isValid ? Qt.darker(parent.palette.window, 1.1) : Qt.darker(Colors.red, 1.5)
Expand Down Expand Up @@ -805,20 +806,65 @@ RowLayout {
id: groupAttributeComponent
ColumnLayout {
id: groupItem
Component.onCompleted: {
spacing: 0
property bool expanded: true

RowLayout {
Layout.fillWidth: true
spacing: 0

ToolButton {
text: groupItem.expanded ? MaterialIcons.expand_more : MaterialIcons.chevron_right
font.family: MaterialIcons.fontFamily
font.pointSize: 10
padding: 2
onClicked: groupItem.expanded = !groupItem.expanded
}

Label {
text: attribute.label
font.bold: true
font.pointSize: 8
Layout.fillWidth: true
elide: Text.ElideRight
padding: 3

ToolTip {
text: {
var tooltip = ""
if (attribute.desc)
tooltip += "<b>" + attribute.desc.name + ":</b> " + attribute.type + "<br>" + Format.plainToHtml(attribute.desc.description)
return tooltip
}
visible: labelMA.containsMouse
delay: 800
}

MouseArea {
id: labelMA
anchors.fill: parent
hoverEnabled: true
onDoubleClicked: function(mouse) { root.doubleClicked(mouse, root.attribute) }
}
}
}

Component.onCompleted: {
var cpt = Qt.createComponent("AttributeEditor.qml");
var obj = cpt.createObject(groupItem,
{
'model': Qt.binding(function() { return attribute.value }),
'readOnly': Qt.binding(function() { return root.readOnly }),
'labelWidth': 100, // Reduce label width for children (space gain)
'labelWidth': Qt.binding(function() { return root.labelWidth }),
'objectsHideable': Qt.binding(function() { return root.objectsHideable }),
'filterText': Qt.binding(function() { return root.filterText }),
'visible': Qt.binding(function() { return groupItem.expanded }),
})
obj.Layout.fillWidth = true;
obj.Layout.leftMargin = 8;
obj.attributeDoubleClicked.connect(
function(attr) {
root.doubleClicked(attr)
function(mouse, attr) {
root.doubleClicked(mouse, attr)
}
)
obj.inAttributeClicked.connect(
Expand All @@ -831,6 +877,11 @@ RowLayout {
root.outAttributeClicked(srcItem, mouse, outAttributes)
}
)
obj.showInViewer.connect(
function(attr) {
root.showInViewer(attr)
}
)
}
}
}
Expand Down
Loading