Introjucer always sets Label colours explicitly


#1

When using Introjucer's GUI Editor I've noticed that it sets two colours for every label component explicitly, even if I've not changed/set them:

label->setColour (TextEditor::textColourId, Colours::black);
label->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

So later these labels will ignore any look-and-feel settings/changes. Bug or feature? :)

Sliders, combo boxes, buttons, toggle buttons, text editors seem to work as I would expect them to.

Latest revision (d7d662bb3853a105daf48a87f5aec1d12e1b2f10) was used to reproduce.


#2

That's just how it lets you adjust the colours in the editor.. neither a bug nor a feature, really!

If you want to suggest code changes to the old gui editor stuff, then please do, but it's not an area I'm spending any time on myself - I have some ideas in mind that should eventually replace it altogether with a better GUI editor system, so tweaking the old one is not a priority for me.


#3

Yeah, I've also decided not to dive in component handler internals and solved my issue with a simple hack in Introjucer's managed component constructor:

 //[UserPreSize]
for (int i = 0; i < getNumChildComponents(); ++i)
{
	Component* comp = getChildComponent(i);

	Label* label = NULL;
	label = dynamic_cast<Label*>(comp);

	if (label != NULL)
	{
		label->removeColour(TextEditor::textColourId);
		label->removeColour(TextEditor::backgroundColourId);
	}
}
//[/UserPreSize]

Maybe this will come in handy for someone.