mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-25 02:04:23 +00:00
Added some extra Label colour IDs to allow control over the text editor colours while it's being edited.
This commit is contained in:
parent
19b412c1a8
commit
1b7c4ea6a4
2 changed files with 17 additions and 4 deletions
|
|
@ -294,6 +294,16 @@ 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));
|
||||
|
||||
return ed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,10 +101,13 @@ public:
|
|||
*/
|
||||
enum ColourIds
|
||||
{
|
||||
backgroundColourId = 0x1000280, /**< The background colour to fill the label with. */
|
||||
textColourId = 0x1000281, /**< The colour for the text. */
|
||||
outlineColourId = 0x1000282 /**< An optional colour to use to draw a border around the label.
|
||||
Leave this transparent to not have an outline. */
|
||||
backgroundColourId = 0x1000280, /**< The background colour to fill the label with. */
|
||||
textColourId = 0x1000281, /**< The colour for the text. */
|
||||
outlineColourId = 0x1000282, /**< An optional colour to use to draw a border around the label.
|
||||
Leave this transparent to not have an outline. */
|
||||
backgroundWhenEditingColourId = 0x1000283, /**< The background colour when the label is being edited. */
|
||||
textWhenEditingColourId = 0x1000284, /**< The colour for the text when the label is being edited. */
|
||||
outlineWhenEditingColourId = 0x1000285 /**< An optional border colour when the label is being edited. */
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue