Skip to content

Commit

Permalink
Add resize limits to AudioConfigurationWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
anjaldoshi committed Oct 11, 2024
1 parent 470d958 commit c6f0be4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ MainWindow::MainWindow (const File& fileToLoad, bool isConsoleApp_) : isConsoleA
documentWindow->setUsingNativeTitleBar (true); // Use native title bar on Mac and Linux
#endif

documentWindow->addToDesktop (documentWindow->getDesktopWindowStyleFlags()); // prevents the maximize
// button from randomly disappearing
documentWindow->addToDesktop();
documentWindow->setVisible (true);
documentWindow->toFront (true);

// Constraining the window's size doesn't seem to work:
documentWindow->setResizeLimits (800, 600, 10000, 10000);
Expand Down
8 changes: 7 additions & 1 deletion Source/Processors/AudioNode/AudioEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ AudioWindowButton::AudioWindowButton()

void AudioWindowButton::paintButton (Graphics& g, bool isMouseOver, bool isButtonDown)
{
float alpha = isMouseOver ? 0.6f : 1.0f;
float alpha = (isMouseOver && getClickingTogglesState()) ? 0.6f : 1.0f;

if (getToggleState())
g.setColour (Colours::yellow.withAlpha (alpha));
Expand Down Expand Up @@ -203,6 +203,7 @@ void AudioEditor::buttonClicked (Button* button)
AccessClass::getAudioComponent()->restartDevice();
audioConfigurationWindow->setLookAndFeel (&getLookAndFeel());
audioConfigurationWindow->setVisible (true);
audioConfigurationWindow->toFront (true);
}
else
{
Expand Down Expand Up @@ -293,6 +294,11 @@ AudioConfigurationWindow::AudioConfigurationWindow (AudioDeviceManager& adm, Aud

setContentOwned (adsc, true);
setVisible (false);

int fixedWidth = adsc->getWidth() + 10;
int fixedHeight = adsc->getHeight() + getTitleBarHeight() + 20;

setResizeLimits (fixedWidth, fixedHeight, fixedWidth, fixedHeight);
}

void AudioConfigurationWindow::closeButtonPressed()
Expand Down

0 comments on commit c6f0be4

Please sign in to comment.