I noticed that in the last Cabbage releases, the titlebar (and the contour of the window) of the running Cabbage plugin is grey, instead of the previous black.
I think the synth/fx developer should have an option to change the window/titlebar color of the Cabbage plugin. For example, in my case, for the graphics of my experimental synth interface, black was more suited.
So, I searched in the Cabbage source code and I found where you can change this:
Of course, it would be very nice if we could set this color with a ātitlebarcolor(ā¦)ā identifier of the form widget (and I noticed that identifier already exists in the source code but actually itās not used).
I tried to make it work but I could not do it because I have no access to a ValueTree widgetData inside that functionā¦
Being that Iām not a C++ expert and I donāt know how the Juce framework works, it was not so easy but I managed to make it workā¦
Now you can use the ātitlebarcolourā identifier to set the titlebar and border colors of your plugin window, independently from the āformā background color (that you can always set with the ācolourā identifier).
I set the default color for the titlebar from the function āCabbageUtilities::getBackgroundSkin()ā.
Another thing that bugged me was that with the previous Cabbage you could make a void titlebar but actually you cannot do that anymore⦠With the caption(āā) there will always be an āUntitledā string in the titlebar. I tried with caption(" ") too, but it didnāt worked because in the Cabbage source code that string is trimmered to remove all the initial whitespaces (is there some specific reason you trimmed the titlebar caption string too?).
Sometimes you want just a void titlebar, because itās more appropriated for your plugin graphics style. For example:
So, I modded the code to make it so that when you use:
form caption("") ...
or donāt use the caption identifier at all, there will be an āUntitledā title, like before. But if you use:
form caption(" ") ...
the title will be void, just like in the above example (window on the right).
If there arenāt specific reasons to make the titlebar always named, I can make a PR with the mods.
P.S.: I donāt know why Juce automatically adds that little vertical gradient to the titlebar. I would like to choice if I want it. Do you know if it can be avoided?
One has to be careful about that as the caption sets the plugin name in certain hosts, including Cabbage itself If I recall correctly. I think it might be safer to just have a way of setting the fontcolour() for the title? Then one can just do fontcolour(0,0,0,0). The fontcolour() identifier already exists, so it should be relatively simple to get this going.
When it comes to graphics, everything can be modified. Youāll need to look at the JUCE and Cabbage look and feel classes.
I didnāt thought of that⦠Yes, it could be safer to just set the alpha color of the titlebar font to a zero. Nice suggestion! I will try that when I have a little more time.
Following your suggestion I made some changes to use the āfontcolourā identifier in the form widget too.
I noticed that the behavior of Juce default lookandfeel of the DocumentWindow class is that the color of the font is calculated based on the background color, to make it always visible over it. With my changes, you can override this behavior by using the fontcolour identifier and set the exact color you want. So, now itās also possible to make a transparent title without removing the plugin name.
Then I added the possibility to alter that light gradient Juce automatically generates in the titlebar of the plugin window (to make that, I added the drawDocumentWindowTitleBar method to the CabbageLookAndFeel2 class and set the PluginWindow component to use the lookandfeel facilities defined in CabbageLookAndFeel2).
To alter the gradient, I added (always to the form widget) the identifier ātitlebargradientamountā that is just a value in the range from 0 to 1.
0 is for NO gradient.
1 is for MAX contrast in the generated gradient.
The value hard-coded in the default Juce lookandfeel used by the DocumentWindow class was 0.15, so I left it as a default.
Cool. Do you think you could make the identifier titlebargradient() instead of titlebatgradientamount() which seems a little long. Most identifiers specify an amount of something, alpha, rotation, etc, yet we never use amount in the identifier. If this is Ok with you just update your sources, it will automatically appear in the PR. You shouldnāt have to make a whole new PR for that. Thanks.
I know itās long, but I added āamountā because I wanted to make it clear that itās not a colour value (like you could expect from the āgradientā word), but a float value in the range [0ā¦1]. Anyway if you confirm it, I can remove it and leave just titlebargradient.
The current convention is that all colour identifiers have the word color in their title. Anyway, I can never bite and update that myself later. Thanks again. Oh wait, I wonāt be able to meet till tomorrow, but I will. Thanks again.
I changed the relevant files via github from web and you too should see the mods in the pull request, but now Iām in office and cannot compile to check if the mod from titlebargradientamount to titlebargradient works. I can see it later when I come back home.
Sorry, I made another little mod because I found that when you use the fontcolour(ā¦) identifier to set the colour you want for the titlebar, if the plugin window was not focused, the titlebar colour didnāt change and that was visually strange⦠So I changed the code to make the titlebar text colour less contrasted when is out of focus when you use the fontcolour identifier too, exactly as it does with the default behavior. I pushed it on github.