mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-04 20:01:58 +02:00
[ui] Add an icon and tooltip on a node's header if it has a comment
If the "Comments" internal attribute is filled, add a corresponding icon in the node's header, as well as a tooltip that contains the comment.
This commit is contained in:
parent
b645db99f7
commit
1015ea448a
2 changed files with 36 additions and 0 deletions
|
@ -75,6 +75,8 @@ Item {
|
|||
onInternalAttributesChanged: {
|
||||
nodeLabel.text = node ? node.label : ""
|
||||
background.color = (node.color === "" ? Qt.lighter(activePalette.base, 1.4) : node.color)
|
||||
nodeCommentTooltip.text = node ? node.comment : ""
|
||||
nodeComment.visible = node.comment != ""
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,6 +260,30 @@ Item {
|
|||
palette.text: "red"
|
||||
ToolTip.text: "Locked"
|
||||
}
|
||||
|
||||
MaterialLabel {
|
||||
id: nodeComment
|
||||
visible: node.comment != ""
|
||||
text: MaterialIcons.comment
|
||||
padding: 2
|
||||
font.pointSize: 7
|
||||
|
||||
ToolTip {
|
||||
id: nodeCommentTooltip
|
||||
parent: header
|
||||
visible: nodeCommentMA.containsMouse && nodeComment.visible
|
||||
text: node.comment
|
||||
implicitWidth: 400 // Forces word-wrap for long comments but the tooltip will be bigger than needed for short comments
|
||||
delay: 300
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
// If the node header is hovered, comments may be displayed
|
||||
id: nodeCommentMA
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue