Rounded corners on main plugin window

I’m attempting to accomplish rounded corners on the main window of a plugin using a paint method like this:

paint (juce::Graphics& g)
{
juce::Colour bg(120,27,38);
juce::Colour transp(120.0f, 0, 0, 50.0f);
g.fillAll(transp);
g.setColour(bg);
juce::Rectangle mainRect(0, 0, getWidth(), getHeight());
g.drawRoundedRectangle(mainRect, 15, 2);
}

Now, the Graphics tutorial suggests I figure out how to make a filled rounded rectangle on my own as an exercise, but doesn’t offer any hint as to how. So I don’t know how I’ll manage to fill it; but what I’m encountering before I get to that is that my transparent red color here is completely ignored. It’s not there at all. It’s a normal rectangular window filled with dark gray or black. I don’t see any other fill commands or colors anywhere in my code. If this black is simply the default, is it possible somehow to make the sharp corners of the main window transparent some other way?

Thank you.

It is impossible to have custom window shapes that work in all hosts and across plugin types. Hosts expect plugin GUIs to be square and might do custom things with windows based on that. Some add their own GUI parts and others paint stuff behind the GUI and there is no way of knowing that. Maybe you could create an extra window with round corners, but your main GUI would still need to stay square.

I guess you want to use
fillRoundedRectangle() instead.

2 Likes

And if I am designing one particular plugin type for one particular host, can I get around those restrictions? I am doing this for Ableton Live. I was planning to do VST3, but apparently AU would also work.
It’s a hypothetical question, though, at this point, as I’m not doing so well getting the plugin running in the first place.
Thanks.