mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
GUI: Ensure components refresh correctly when their look and feel changes
This commit is contained in:
parent
68e0e0e329
commit
39b5c22a29
10 changed files with 48 additions and 14 deletions
|
|
@ -105,16 +105,15 @@ FileBrowserComponent::FileBrowserComponent (int flags_,
|
|||
addAndMakeVisible (fileLabel);
|
||||
fileLabel.attachToComponent (&filenameBox, true);
|
||||
|
||||
goUpButton.reset (getLookAndFeel().createFileBrowserGoUpButton());
|
||||
addAndMakeVisible (goUpButton.get());
|
||||
goUpButton->onClick = [this] { goUp(); };
|
||||
goUpButton->setTooltip (TRANS ("Go up to parent directory"));
|
||||
|
||||
if (previewComp != nullptr)
|
||||
addAndMakeVisible (previewComp);
|
||||
|
||||
lookAndFeelChanged();
|
||||
|
||||
addAndMakeVisible (goUpButton.get());
|
||||
goUpButton->onClick = [this] { goUp(); };
|
||||
goUpButton->setTooltip (TRANS ("Go up to parent directory"));
|
||||
|
||||
setRoot (currentRoot);
|
||||
|
||||
if (filename.isNotEmpty())
|
||||
|
|
@ -351,12 +350,17 @@ void FileBrowserComponent::resized()
|
|||
//==============================================================================
|
||||
void FileBrowserComponent::lookAndFeelChanged()
|
||||
{
|
||||
goUpButton.reset (getLookAndFeel().createFileBrowserGoUpButton());
|
||||
|
||||
currentPathBox.setColour (ComboBox::backgroundColourId, findColour (currentPathBoxBackgroundColourId));
|
||||
currentPathBox.setColour (ComboBox::textColourId, findColour (currentPathBoxTextColourId));
|
||||
currentPathBox.setColour (ComboBox::arrowColourId, findColour (currentPathBoxArrowColourId));
|
||||
|
||||
filenameBox.setColour (TextEditor::backgroundColourId, findColour (filenameBoxBackgroundColourId));
|
||||
filenameBox.setColour (TextEditor::textColourId, findColour (filenameBoxTextColourId));
|
||||
|
||||
resized();
|
||||
repaint();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue