From 9d52538e919e38b064da8fce174f227a08b2b38e Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 31 May 2017 11:27:33 +0100 Subject: [PATCH] Standalone plug-in: Fixed an issue where resizing a plugin's editor in standalone mode would not resize the parent window --- .../Standalone/juce_StandaloneFilterWindow.h | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index 5330d5656f..42baea647e 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -673,7 +673,9 @@ public: private: //============================================================================== - class MainContentComponent : public Component, private Value::Listener, Button::Listener + class MainContentComponent : public Component, private Value::Listener, + Button::Listener, + ComponentListener { public: MainContentComponent (StandaloneFilterWindow& filterWindow) @@ -683,7 +685,14 @@ private: { Value& inputMutedValue = owner.pluginHolder->getMuteInputValue(); - addAndMakeVisible (editor); + if (editor != nullptr) + { + editor->addComponentListener (this); + componentMovedOrResized (*editor, false, true); + + addAndMakeVisible (editor); + } + addChildComponent (notification); if (owner.pluginHolder->getProcessorHasPotentialFeedbackLoop()) @@ -699,6 +708,7 @@ private: { if (editor != nullptr) { + editor->removeComponentListener (this); owner.pluginHolder->processor->editorBeingDeleted (editor); editor = nullptr; } @@ -783,6 +793,14 @@ private: #endif } + //============================================================================== + void componentMovedOrResized (Component&, bool, bool wasResized) override + { + if (wasResized && editor != nullptr) + setSize (editor->getWidth(), + editor->getHeight() + (shouldShowNotification ? NotificationArea::height : 0)); + } + //============================================================================== StandaloneFilterWindow& owner; NotificationArea notification;