paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
3.06k stars 823 forks source link

ShadowColor not taken into account when setting NodeStyle after creation #232

Open DexterMagnific opened 5 years ago

DexterMagnific commented 5 years ago

Hi,

The ShadowColor set on a node after its creation is not taken into account. This is because it is not forwarded to the QGraphicsDropShadowEffect installed:

NodeStyle s(n->nodeDataModel()->nodeStyle());

s.ShadowColor = color;
n->nodeDataModel()->setNodeStyle(s);

Workaround: Set it manually

static_cast<QGraphicsDropShadowEffect *>(n->nodeGraphicsObject().graphicsEffect())->setColor(s.ShadowColor);
paceholder commented 5 years ago

Hi,

I simply was not intended to make colored shadows. Shadow is shadow -- it is gray/black/dark.

Of course except when you have a good reason to do so. Could you please explain your use case?

Regards,

Dmitry

DexterMagnific commented 5 years ago

Use case: we have an app in which we offer the ability to the user to set custom node background color (single background, all GradientX are the same). When changing the color, we also change the shadow color to the selected color (darker). We think it looks nicer when the shadow follows the bg color.

Apart from any use case consideration, a setStyle() should do its job right: apply all the entries to the object, including ShadowColor.