diff --git a/modules/juce_gui_basics/layout/juce_SidePanel.cpp b/modules/juce_gui_basics/layout/juce_SidePanel.cpp index 54a143a0db..825995e2d5 100644 --- a/modules/juce_gui_basics/layout/juce_SidePanel.cpp +++ b/modules/juce_gui_basics/layout/juce_SidePanel.cpp @@ -108,9 +108,6 @@ void SidePanel::showOrHide (bool show) if (isShowing && ! isVisible()) setVisible (true); - - if (onPanelShowHide != nullptr) - onPanelShowHide (isShowing); } } @@ -255,8 +252,14 @@ void SidePanel::componentMovedOrResized (Component& component, bool wasMoved, bo void SidePanel::changeListenerCallback (ChangeBroadcaster*) { - if (isVisible() && ! isShowing && ! Desktop::getInstance().getAnimator().isAnimating (this)) - setVisible (false); + if (! Desktop::getInstance().getAnimator().isAnimating (this)) + { + if (onPanelShowHide != nullptr) + onPanelShowHide (isShowing); + + if (isVisible() && ! isShowing) + setVisible (false); + } } Rectangle SidePanel::calculateBoundsInParent (Component& parentComp) const