@@ -105,16 +105,15 @@ FileBrowserComponent::FileBrowserComponent (int flags_, | |||||
addAndMakeVisible (fileLabel); | addAndMakeVisible (fileLabel); | ||||
fileLabel.attachToComponent (&filenameBox, true); | 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) | if (previewComp != nullptr) | ||||
addAndMakeVisible (previewComp); | addAndMakeVisible (previewComp); | ||||
lookAndFeelChanged(); | lookAndFeelChanged(); | ||||
addAndMakeVisible (goUpButton.get()); | |||||
goUpButton->onClick = [this] { goUp(); }; | |||||
goUpButton->setTooltip (TRANS ("Go up to parent directory")); | |||||
setRoot (currentRoot); | setRoot (currentRoot); | ||||
if (filename.isNotEmpty()) | if (filename.isNotEmpty()) | ||||
@@ -351,12 +350,17 @@ void FileBrowserComponent::resized() | |||||
//============================================================================== | //============================================================================== | ||||
void FileBrowserComponent::lookAndFeelChanged() | void FileBrowserComponent::lookAndFeelChanged() | ||||
{ | { | ||||
goUpButton.reset (getLookAndFeel().createFileBrowserGoUpButton()); | |||||
currentPathBox.setColour (ComboBox::backgroundColourId, findColour (currentPathBoxBackgroundColourId)); | currentPathBox.setColour (ComboBox::backgroundColourId, findColour (currentPathBoxBackgroundColourId)); | ||||
currentPathBox.setColour (ComboBox::textColourId, findColour (currentPathBoxTextColourId)); | currentPathBox.setColour (ComboBox::textColourId, findColour (currentPathBoxTextColourId)); | ||||
currentPathBox.setColour (ComboBox::arrowColourId, findColour (currentPathBoxArrowColourId)); | currentPathBox.setColour (ComboBox::arrowColourId, findColour (currentPathBoxArrowColourId)); | ||||
filenameBox.setColour (TextEditor::backgroundColourId, findColour (filenameBoxBackgroundColourId)); | filenameBox.setColour (TextEditor::backgroundColourId, findColour (filenameBoxBackgroundColourId)); | ||||
filenameBox.setColour (TextEditor::textColourId, findColour (filenameBoxTextColourId)); | filenameBox.setColour (TextEditor::textColourId, findColour (filenameBoxTextColourId)); | ||||
resized(); | |||||
repaint(); | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -56,9 +56,7 @@ struct CustomMenuBarItemHolder : public Component | |||||
//============================================================================== | //============================================================================== | ||||
BurgerMenuComponent::BurgerMenuComponent (MenuBarModel* modelToUse) | BurgerMenuComponent::BurgerMenuComponent (MenuBarModel* modelToUse) | ||||
{ | { | ||||
auto& lf = getLookAndFeel(); | |||||
listBox.setRowHeight (roundToInt (lf.getPopupMenuFont().getHeight() * 2.0f)); | |||||
lookAndFeelChanged(); | |||||
listBox.addMouseListener (this, true); | listBox.addMouseListener (this, true); | ||||
setModel (modelToUse); | setModel (modelToUse); | ||||
@@ -283,4 +281,9 @@ void BurgerMenuComponent::handleCommandMessage (int commandID) | |||||
} | } | ||||
} | } | ||||
void BurgerMenuComponent::lookAndFeelChanged() | |||||
{ | |||||
listBox.setRowHeight (roundToInt (getLookAndFeel().getPopupMenuFont().getHeight() * 2.0f)); | |||||
} | |||||
} // namespace juce | } // namespace juce |
@@ -62,6 +62,9 @@ public: | |||||
/** Returns the current burger menu model being used. */ | /** Returns the current burger menu model being used. */ | ||||
MenuBarModel* getModel() const noexcept; | MenuBarModel* getModel() const noexcept; | ||||
/** @internal */ | |||||
void lookAndFeelChanged() override; | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||
struct Row | struct Row | ||||
@@ -25,9 +25,10 @@ struct PropertyPanel::SectionComponent : public Component | |||||
const Array<PropertyComponent*>& newProperties, | const Array<PropertyComponent*>& newProperties, | ||||
bool sectionIsOpen) | bool sectionIsOpen) | ||||
: Component (sectionTitle), | : Component (sectionTitle), | ||||
titleHeight (getLookAndFeel().getPropertyPanelSectionHeaderHeight (sectionTitle)), | |||||
isOpen (sectionIsOpen) | isOpen (sectionIsOpen) | ||||
{ | { | ||||
lookAndFeelChanged(); | |||||
propertyComps.addArray (newProperties); | propertyComps.addArray (newProperties); | ||||
for (auto* propertyComponent : propertyComps) | for (auto* propertyComponent : propertyComps) | ||||
@@ -59,6 +60,13 @@ struct PropertyPanel::SectionComponent : public Component | |||||
} | } | ||||
} | } | ||||
void lookAndFeelChanged() override | |||||
{ | |||||
titleHeight = getLookAndFeel().getPropertyPanelSectionHeaderHeight (getName()); | |||||
resized(); | |||||
repaint(); | |||||
} | |||||
int getPreferredHeight() const | int getPreferredHeight() const | ||||
{ | { | ||||
auto y = titleHeight; | auto y = titleHeight; | ||||
@@ -235,7 +235,7 @@ private: | |||||
//============================================================================== | //============================================================================== | ||||
Toolbar::Toolbar() | Toolbar::Toolbar() | ||||
{ | { | ||||
missingItemsButton.reset (getLookAndFeel().createToolbarMissingItemsButton (*this)); | |||||
lookAndFeelChanged(); | |||||
addChildComponent (missingItemsButton.get()); | addChildComponent (missingItemsButton.get()); | ||||
missingItemsButton->setAlwaysOnTop (true); | missingItemsButton->setAlwaysOnTop (true); | ||||
@@ -633,6 +633,11 @@ void Toolbar::itemDropped (const SourceDetails& dragSourceDetails) | |||||
tc->setState (Button::buttonNormal); | tc->setState (Button::buttonNormal); | ||||
} | } | ||||
void Toolbar::lookAndFeelChanged() | |||||
{ | |||||
missingItemsButton.reset (getLookAndFeel().createToolbarMissingItemsButton (*this)); | |||||
} | |||||
void Toolbar::mouseDown (const MouseEvent&) {} | void Toolbar::mouseDown (const MouseEvent&) {} | ||||
//============================================================================== | //============================================================================== | ||||
@@ -296,6 +296,8 @@ public: | |||||
/** @internal */ | /** @internal */ | ||||
void itemDropped (const SourceDetails&) override; | void itemDropped (const SourceDetails&) override; | ||||
/** @internal */ | /** @internal */ | ||||
void lookAndFeelChanged() override; | |||||
/** @internal */ | |||||
void updateAllItemPositions (bool animate); | void updateAllItemPositions (bool animate); | ||||
/** @internal */ | /** @internal */ | ||||
static ToolbarItemComponent* createItem (ToolbarItemFactory&, int itemId); | static ToolbarItemComponent* createItem (ToolbarItemFactory&, int itemId); | ||||
@@ -44,9 +44,7 @@ CallOutBox::CallOutBox (Component& c, Rectangle<int> area, Component* const pare | |||||
creationTime = Time::getCurrentTime(); | creationTime = Time::getCurrentTime(); | ||||
} | } | ||||
CallOutBox::~CallOutBox() | |||||
{ | |||||
} | |||||
CallOutBox::~CallOutBox() = default; | |||||
//============================================================================== | //============================================================================== | ||||
class CallOutBoxCallback : public ModalComponentManager::Callback, | class CallOutBoxCallback : public ModalComponentManager::Callback, | ||||
@@ -94,6 +92,8 @@ int CallOutBox::getBorderSize() const noexcept | |||||
return jmax (getLookAndFeel().getCallOutBoxBorderSize (*this), (int) arrowSize); | return jmax (getLookAndFeel().getCallOutBoxBorderSize (*this), (int) arrowSize); | ||||
} | } | ||||
void CallOutBox::lookAndFeelChanged() { resized(); repaint(); } | |||||
void CallOutBox::paint (Graphics& g) | void CallOutBox::paint (Graphics& g) | ||||
{ | { | ||||
getLookAndFeel().drawCallOutBoxBackground (*this, g, outline, background); | getLookAndFeel().drawCallOutBoxBackground (*this, g, outline, background); | ||||
@@ -159,6 +159,8 @@ public: | |||||
void handleCommandMessage (int) override; | void handleCommandMessage (int) override; | ||||
/** @internal */ | /** @internal */ | ||||
int getBorderSize() const noexcept; | int getBorderSize() const noexcept; | ||||
/** @internal */ | |||||
void lookAndFeelChanged() override; | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||
@@ -341,7 +341,7 @@ CodeEditorComponent::CodeEditorComponent (CodeDocument& doc, CodeTokeniser* cons | |||||
setMouseCursor (MouseCursor::IBeamCursor); | setMouseCursor (MouseCursor::IBeamCursor); | ||||
setWantsKeyboardFocus (true); | setWantsKeyboardFocus (true); | ||||
caret.reset (getLookAndFeel().createCaretComponent (this)); | |||||
lookAndFeelChanged(); | |||||
addAndMakeVisible (caret.get()); | addAndMakeVisible (caret.get()); | ||||
addAndMakeVisible (verticalScrollBar); | addAndMakeVisible (verticalScrollBar); | ||||
@@ -1308,6 +1308,11 @@ bool CodeEditorComponent::perform (const InvocationInfo& info) | |||||
return performCommand (info.commandID); | return performCommand (info.commandID); | ||||
} | } | ||||
void CodeEditorComponent::lookAndFeelChanged() | |||||
{ | |||||
caret.reset (getLookAndFeel().createCaretComponent (this)); | |||||
} | |||||
bool CodeEditorComponent::performCommand (const CommandID commandID) | bool CodeEditorComponent::performCommand (const CommandID commandID) | ||||
{ | { | ||||
switch (commandID) | switch (commandID) | ||||
@@ -371,6 +371,8 @@ public: | |||||
void getCommandInfo (CommandID, ApplicationCommandInfo&) override; | void getCommandInfo (CommandID, ApplicationCommandInfo&) override; | ||||
/** @internal */ | /** @internal */ | ||||
bool perform (const InvocationInfo&) override; | bool perform (const InvocationInfo&) override; | ||||
/** @internal */ | |||||
void lookAndFeelChanged() override; | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||