TextEditor - Text Colour by Enablement


#1

Hi.

Since the TextEditor can hold many sections with different colours, I was wondering how can I, say, change the opacity of the text when the TextEditor is disabled.
I looked at the LookAndFeel methods and the TextEditor’s paint method and there’s nothing I can find there… It seems like the drawing methods are in internal classes.

It just looks weird… When I disable my content component, all of the text in ComboBoxes and Labels is dimmed but the text in the TextEditor remains unchanged.

Anyone have an idea?

Thanks.


#2

You could change the alpha of the whole component with Component::setAlpha()?


#3

This way I will have to treat TextEditor specifically in my LookAndFeel…
I am changing the controls’ background and outline colours according to enablement… Setting a different alpha only to the TextEditor will result in a different background and outline colours…

Anything you can change in Juce to fix it? Other controls are changing their text colour (0.5f alpha) according to enablement… I believe unifying such behaviors is important, of course its probably not at the top of your priorities :slight_smile:


#4

Yeah, not a very high priority for me… (And TBH in a lot of situations, other people won’t actually want the colour to change like that)