Skip to content

Commit

Permalink
[GraphEditor] Refer to an attribute's parent in its tooltip
Browse files Browse the repository at this point in the history
If an attribute belongs to a `GroupAttribute` or a `ListAttribute`,
it has a parent, and its full name is "parentName.attributeName".
Instead of displaying only "attributeName" in the tooltip, this commit
now displays "parentName.attributeName" to ensure that the link is obvious.
  • Loading branch information
cbentejac committed Sep 26, 2024
1 parent b10027b commit 0e0455d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ RowLayout {
function updateAttributeLabel() {
background.color = attribute.validValue ? Qt.darker(palette.window, 1.1) : Qt.darker(Colors.red, 1.5)

console.warn("about to enter if")
if (attribute.desc) {
var tooltip = ""
if (!attribute.validValue && attribute.desc.errorMessage !== "")
tooltip += "<i><b>Error: </b>" + Format.plainToHtml(attribute.desc.errorMessage) + "</i><br><br>"
tooltip += "<b> " + attribute.desc.name + ":</b> " + attribute.type + "<br>" + Format.plainToHtml(attribute.desc.description)
tooltip += "<b> " + attribute.fullName + ":</b> " + attribute.type + "<br>" + Format.plainToHtml(attribute.desc.description)

console.warn(attribute.fullName)
parameterTooltip.text = tooltip
}
}
Expand Down Expand Up @@ -81,7 +83,7 @@ RowLayout {
var tooltip = ""
if (!object.validValue && object.desc.errorMessage !== "")
tooltip += "<i><b>Error: </b>" + Format.plainToHtml(object.desc.errorMessage) + "</i><br><br>"
tooltip += "<b>" + object.desc.name + ":</b> " + attribute.type + "<br>" + Format.plainToHtml(object.description)
tooltip += "<b>" + object.fullName + ":</b> " + attribute.type + "<br>" + Format.plainToHtml(object.description)
return tooltip
}
visible: parameterMA.containsMouse
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/qml/GraphEditor/AttributePin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RowLayout {
spacing: 3

ToolTip {
text: attribute.name + ": " + attribute.type
text: attribute.fullName + ": " + attribute.type
visible: nameLabel.hovered

y: nameLabel.y + nameLabel.height
Expand Down

0 comments on commit 0e0455d

Please sign in to comment.