1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Re-attach ResizableCornerComponent when calling AudioProcessorEditor::setContrainer() so the new constrainer is respected

This commit is contained in:
ed 2020-01-28 09:44:23 +00:00
parent 9798f672c4
commit dde8f4b68c
2 changed files with 13 additions and 7 deletions

View file

@ -103,15 +103,9 @@ void AudioProcessorEditor::setResizable (const bool shouldBeResizable, const boo
if (shouldHaveCornerResizer != (resizableCorner != nullptr)) if (shouldHaveCornerResizer != (resizableCorner != nullptr))
{ {
if (shouldHaveCornerResizer) if (shouldHaveCornerResizer)
{ attachResizableCornerComponent();
resizableCorner.reset (new ResizableCornerComponent (this, constrainer));
Component::addChildComponent (resizableCorner.get());
resizableCorner->setAlwaysOnTop (true);
}
else else
{
resizableCorner.reset(); resizableCorner.reset();
}
} }
} }
@ -146,6 +140,9 @@ void AudioProcessorEditor::setConstrainer (ComponentBoundsConstrainer* newConstr
|| newConstrainer->getMinimumHeight() != newConstrainer->getMaximumHeight()); || newConstrainer->getMinimumHeight() != newConstrainer->getMaximumHeight());
attachConstrainer (newConstrainer); attachConstrainer (newConstrainer);
if (resizableCorner != nullptr)
attachResizableCornerComponent();
} }
} }
@ -158,6 +155,14 @@ void AudioProcessorEditor::attachConstrainer (ComponentBoundsConstrainer* newCon
} }
} }
void AudioProcessorEditor::attachResizableCornerComponent()
{
resizableCorner.reset (new ResizableCornerComponent (this, constrainer));
Component::addChildComponent (resizableCorner.get());
resizableCorner->setAlwaysOnTop (true);
editorResized (true);
}
void AudioProcessorEditor::setBoundsConstrained (Rectangle<int> newBounds) void AudioProcessorEditor::setBoundsConstrained (Rectangle<int> newBounds)
{ {
if (constrainer != nullptr) if (constrainer != nullptr)

View file

@ -200,6 +200,7 @@ private:
void editorResized (bool wasResized); void editorResized (bool wasResized);
void updatePeer(); void updatePeer();
void attachConstrainer (ComponentBoundsConstrainer*); void attachConstrainer (ComponentBoundsConstrainer*);
void attachResizableCornerComponent();
//============================================================================== //==============================================================================
std::unique_ptr<AudioProcessorEditorListener> resizeListener; std::unique_ptr<AudioProcessorEditorListener> resizeListener;