Modify CalloutBox Path from LookAndFeel


#1

Hi, I'm tying to write a LookAndFeel mimicing another application and would like to come as close as possible. Therefore I'd need to change the corner radius (and arrowshape) of the callout boxes from my LookAndFeel. You could expose a CalloutBox::getPathShape() function for the LookAndFeel class returning a Path object. This would make it very flexible, but would not break the API. Right now you always have 9.0px corner radius and a speech bubble in every LookAndFeel no matter what, unless you create your own CalloutBox class.


#2

Yeah, this has been requested before, I'll do it at some point!


#3

Is there perhaps also possible to make the callout box set a new look and feel before it's made visible / added to the desktop?

The way it works now it shows the original callout box for a split second before the LookAndFeel changes.. 

I'm not sure if I'm doing something wrong? 

    void launchCalloutBox (Parameter* associatedParam)

    {

        PopupEditComponent *editor = new PopupEditComponent (associatedParam);

        editor->setSize (125, 60);
 

        CallOutBox& coBox = CallOutBox::launchAsynchronously (editor, getScreenBounds(), nullptr);

        coBox.setLookAndFeel (TSELookAndFeelManager::getInstanceWithoutCreating()->getDarkCalloutBox());

        coBox.setSize (editor->getWidth(), editor->getHeight());

        editor->centreWithSize (editor->getWidth(), editor->getHeight());

    }

 

Demonstration: https://www.dropbox.com/s/4te064bjd1nyhsy/calloutbox.mov?dl=0

(The first instance of the callout box is most noticable in this video, but it's consistent in the software) ..

Not a deal-breaker, but a little annoying ;)


#4

I would really appreciate something like that too :slight_smile:


#5

I still wish this was possible whenever I need a CalloutBox