diff --git a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp index c50271ea99..21d44cc7db 100644 --- a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp +++ b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp @@ -282,6 +282,14 @@ ConcertinaPanel::ConcertinaPanel() ConcertinaPanel::~ConcertinaPanel() {} +Component* ConcertinaPanel::getPanel (int index) const noexcept +{ + if (PanelHolder* h = holders[index]) + return h->component; + + return nullptr; +} + void ConcertinaPanel::addPanel (int insertIndex, Component* component, bool takeOwnership) { jassert (component != nullptr); // can't use a null pointer here! diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp index 317ea400a5..98ee004469 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp @@ -86,10 +86,10 @@ void LookAndFeel_V3::drawConcertinaPanelHeader (Graphics& g, const RectangleassociatedObjectNames.indexOf (name); + const int index = c->associatedObjectNames.indexOf (name); - if (index >= 0) - { - c->associatedObjects.set (index, newObject); - } - else - { - c->associatedObjectNames.add (name); - c->associatedObjects.add (newObject); + if (index >= 0) + { + c->associatedObjects.set (index, newObject); + } + else + { + c->associatedObjectNames.add (name); + c->associatedObjects.add (newObject); + } } }