1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-03 03:30:06 +00:00

Standalone plug-in: Fixed an issue where resizing a plugin's editor in standalone mode would not resize the parent window

This commit is contained in:
hogliux 2017-05-31 11:27:33 +01:00 committed by tpoole
parent 1f40db45a5
commit 9d52538e91

View file

@ -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;