1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

GUI: Ensure components refresh correctly when their look and feel changes

This commit is contained in:
reuk 2020-06-12 15:24:20 +01:00
parent 68e0e0e329
commit 39b5c22a29
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
10 changed files with 48 additions and 14 deletions

View file

@ -341,7 +341,7 @@ CodeEditorComponent::CodeEditorComponent (CodeDocument& doc, CodeTokeniser* cons
setMouseCursor (MouseCursor::IBeamCursor);
setWantsKeyboardFocus (true);
caret.reset (getLookAndFeel().createCaretComponent (this));
lookAndFeelChanged();
addAndMakeVisible (caret.get());
addAndMakeVisible (verticalScrollBar);
@ -1308,6 +1308,11 @@ bool CodeEditorComponent::perform (const InvocationInfo& info)
return performCommand (info.commandID);
}
void CodeEditorComponent::lookAndFeelChanged()
{
caret.reset (getLookAndFeel().createCaretComponent (this));
}
bool CodeEditorComponent::performCommand (const CommandID commandID)
{
switch (commandID)

View file

@ -371,6 +371,8 @@ public:
void getCommandInfo (CommandID, ApplicationCommandInfo&) override;
/** @internal */
bool perform (const InvocationInfo&) override;
/** @internal */
void lookAndFeelChanged() override;
private:
//==============================================================================