Hello to the JUCE team ! Hello @jules !
I have a question about that specific part of juce_Label.cpp :
TextEditor* Label::createEditorComponent()
{
auto* ed = new TextEditor (getName());
ed->applyFontToAllText (getLookAndFeel().getLabelFont (*this));
copyAllExplicitColoursTo (*ed);
copyColourIfSpecified (*this, *ed, textWhenEditingColourId, TextEditor::textColourId);
copyColourIfSpecified (*this, *ed, backgroundWhenEditingColourId, TextEditor::backgroundColourId);
copyColourIfSpecified (*this, *ed, outlineWhenEditingColourId, TextEditor::focusedOutlineColourId);
return ed;
}
I came across a problem one day because I wasn’t able to change the font being used in the TextEditor which is displayed when the Label is editable. I discovered that was because of that function, and because I was using at some point label->setFont() and that what was provided there wasn’t taken into account.
So here is my question : would it make more sense in the JUCE base code to have ed->applyFontToAllText (getFont ()); instead of ed->applyFontToAllText (getLookAndFeel().getLabelFont (*this)); ? To me, the function getFont() always provides the accurate Font being used by the Label, which came from the LookAndFeel definition until it is overrided by Label::setFont, which isn’t detected by the current implementation.
Thanks in advance !
Ivan
