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:
parent
9798f672c4
commit
dde8f4b68c
2 changed files with 13 additions and 7 deletions
|
|
@ -103,16 +103,10 @@ void AudioProcessorEditor::setResizable (const bool shouldBeResizable, const boo
|
|||
if (shouldHaveCornerResizer != (resizableCorner != nullptr))
|
||||
{
|
||||
if (shouldHaveCornerResizer)
|
||||
{
|
||||
resizableCorner.reset (new ResizableCornerComponent (this, constrainer));
|
||||
Component::addChildComponent (resizableCorner.get());
|
||||
resizableCorner->setAlwaysOnTop (true);
|
||||
}
|
||||
attachResizableCornerComponent();
|
||||
else
|
||||
{
|
||||
resizableCorner.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AudioProcessorEditor::setResizeLimits (int newMinimumWidth,
|
||||
|
|
@ -146,6 +140,9 @@ void AudioProcessorEditor::setConstrainer (ComponentBoundsConstrainer* newConstr
|
|||
|| newConstrainer->getMinimumHeight() != newConstrainer->getMaximumHeight());
|
||||
|
||||
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)
|
||||
{
|
||||
if (constrainer != nullptr)
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ private:
|
|||
void editorResized (bool wasResized);
|
||||
void updatePeer();
|
||||
void attachConstrainer (ComponentBoundsConstrainer*);
|
||||
void attachResizableCornerComponent();
|
||||
|
||||
//==============================================================================
|
||||
std::unique_ptr<AudioProcessorEditorListener> resizeListener;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue