Add "color" as an internal attribute

Setting this attribute allows the user to change the color
of a node, either by directly providing an SVG color name or an
hexadecimal color code, or by picking a color with the selector.
This commit is contained in:
Candice Bentéjac 2022-08-02 14:16:11 +02:00
parent 330382ab0c
commit 21d01acc9a
4 changed files with 98 additions and 1 deletions

View file

@ -74,6 +74,7 @@ Item {
onInternalAttributesChanged: {
nodeLabel.text = node ? node.label : ""
background.color = (node.color === "" ? Qt.lighter(activePalette.base, 1.4) : node.color)
}
}
@ -142,7 +143,7 @@ Item {
Rectangle {
id: background
anchors.fill: nodeContent
color: Qt.lighter(activePalette.base, 1.4)
color: node.color === "" ? Qt.lighter(activePalette.base, 1.4) : node.color
layer.enabled: true
layer.effect: DropShadow { radius: 3; color: shadowColor }
radius: 3