|
|
@@ -289,20 +289,21 @@ bool Label::isBeingEdited() const noexcept |
|
|
|
return editor != nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void copyColourIfSpecified (Label& l, TextEditor& ed, int colourID, int targetColourID)
|
|
|
|
{
|
|
|
|
if (l.isColourSpecified (colourID) || l.getLookAndFeel().isColourSpecified (colourID))
|
|
|
|
ed.setColour (targetColourID, l.findColour (colourID));
|
|
|
|
}
|
|
|
|
|
|
|
|
TextEditor* Label::createEditorComponent()
|
|
|
|
{
|
|
|
|
TextEditor* const ed = new TextEditor (getName());
|
|
|
|
ed->applyFontToAllText (getLookAndFeel().getLabelFont (*this));
|
|
|
|
copyAllExplicitColoursTo (*ed);
|
|
|
|
|
|
|
|
if (isColourSpecified (textWhenEditingColourId))
|
|
|
|
ed->setColour (TextEditor::textColourId, findColour (textWhenEditingColourId));
|
|
|
|
|
|
|
|
if (isColourSpecified (backgroundWhenEditingColourId))
|
|
|
|
ed->setColour (TextEditor::backgroundColourId, findColour (backgroundWhenEditingColourId));
|
|
|
|
|
|
|
|
if (isColourSpecified (outlineWhenEditingColourId))
|
|
|
|
ed->setColour (TextEditor::outlineColourId, findColour (outlineWhenEditingColourId));
|
|
|
|
copyColourIfSpecified (*this, *ed, textWhenEditingColourId, TextEditor::textColourId);
|
|
|
|
copyColourIfSpecified (*this, *ed, backgroundWhenEditingColourId, TextEditor::backgroundColourId);
|
|
|
|
copyColourIfSpecified (*this, *ed, outlineWhenEditingColourId, TextEditor::outlineColourId);
|
|
|
|
|
|
|
|
return ed;
|
|
|
|
}
|
|
|
|