TabbedComponent LookAndFeel


#1

Hi,

i would like to style my TabbedComponent content area with a nice pattern, but i could not find out how this can be done.

(Actually i couldn't even find out which colour is used for that purpose as "TabbedComponent::ColourIds::backgroundColourId" changes the background behind the content area and not the content area itself.)

There are LookAndFeel functions to draw the TabbedButtonBar, but i don't know how the content area can be styled.

Of course i could also change the LookAndFeel of the Components that are configured as content of the individual tabs, but again i don't know which type of Component could be used for that purpose.

For the "GroupComponent" there are LookAndFeel functions, so i could use it without the title bar, but then i have nothing to further partition the content anymore.

Thanks in advance,

Iodun/Benjamin


#2

I just noticed, that each tab's content area is colored individually with "setTabBackgroundColour", but that is still not enough for my purposes.

Would it be possible to extend my own LookAndFeel class with some more functions to draw custom made components?

At the moment i have a "StyleEngine" derived from "LookAndFeel_V3".

Maybe i could add some functions, get the "LookAndFeel" instance via "LookAndFeel::getDefaultLookAndFeel()" and somehow cast it back to my "StyleEngine" type. Then i could call my new custom draw methods in the "paint()" method of my custom components.

Would that even work?

Is there a better way that doesn't feel dirty? :)

 

 


#3

You can fill the background of each tab component however you like, just by painting the background of the component that you put there.

And to customise the buttons, you'd just need to use a look+feel that overrides drawTabButton()