I’m using a custom LookAndFeel to draw callout boxes with sharp corners.
I’m displaying a callout like this
callout.reset (new CallOutBox (infoPanel, targetArea, this));
callout->setLookAndFeel (calloutLookAndFeel);
callout->enterModalState (true);
The problem is that the shape of the callout path is calculated in its constructor, when the look and feel it has access to is still the default one (that has rounded corners).
I expected assigning a new look and feel (the one that results in sharp corners) to the callout would make it recalculate its path, but that does not happen.
The fix is easy: it is enough to add this to the CallOutBox class:
Yep, it’s not an actual solution. Like, it forces these elements to be global for the whole GUI. I wasn’t sure if that was intended or just an omission.
Buuump, my first post above still has got no feedback from any JUCE maintainer for what seems like a JUCE (small) bug
TL;DR:
In the constructor of a CallOutBox, the shape of its outline is calculated as a Path (with rounded corners of a certain radius, etc.)
A LookAndFeel can legitimately want its CallOutBoxes to have a different shape (e.g. with sharp corners)
At the moment, changing the LookAndFeel of an existing CallOutBox does not cause the recalculation of the Path for its outline according to the new LookAndFeel
One would expect that the outline gets updated according to the new LookAndFeel instead, and that’s easily achieved by overriding lookAndFeelChanged() in the CallOutBox class and calling the private CallOutBox::refreshPath() from there.