Overriding Introjucer-set colours with custom LookAndFeel


#1

I've built the UI of my plugin using the Introjucer, and now I would like to override all the component colours with the ones I set in my custom LookAndFeel object. Although it will use my LAF class's custom drawing method for rotary sliders, it still uses the colours set in the Introjucer. 

I've edited my main window code so the contructor contains:

    //[UserPreSize]
    laf.setColour(Slider::rotarySliderFillColourId, Colours::white);
    laf.setColour(Label::textColourId, Colours::white);
    LookAndFeel::setDefaultLookAndFeel(&laf);
    sendLookAndFeelChange();
    //[/UserPreSize]

Am I missing something?


#2

If you set the colours in IJ, then you either need to unset them (i.e. set them to default) or you have to hardcode your LnF to use the colours you want rather than the colour IDs.

If you choose the first method, then the colours won't show up in IJ, but they will in the build. The 2nd method locks your colours in and is less flexible.


#3

Ah, resetting them to the default does the trick. Thanks! I didn't realize I was backing myself into a corner when I set the colours in the IJ.