Browse Source

tags/2021-05-28
jules 17 years ago
parent
commit
d7b5413e70
2 changed files with 8 additions and 11 deletions
  1. +2
    -0
      src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp
  2. +6
    -11
      src/juce_appframework/gui/components/windows/juce_ResizableWindow.cpp

+ 2
- 0
src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp View File

@@ -60,6 +60,8 @@ DocumentWindow::DocumentWindow (const String& title,
{ {
zeromem (titleBarButtons, sizeof (titleBarButtons)); zeromem (titleBarButtons, sizeof (titleBarButtons));
setResizeLimits (128, 128, 32768, 32768);
lookAndFeelChanged(); lookAndFeelChanged();
} }


+ 6
- 11
src/juce_appframework/gui/components/windows/juce_ResizableWindow.cpp View File

@@ -50,24 +50,16 @@ ResizableWindow::ResizableWindow (const String& name,
contentComponent (0), contentComponent (0),
resizeToFitContent (false), resizeToFitContent (false),
fullscreen (false), fullscreen (false),
constrainer (&defaultConstrainer)
constrainer (0)
#ifdef JUCE_DEBUG #ifdef JUCE_DEBUG
, hasBeenResized (false) , hasBeenResized (false)
#endif #endif
{ {
setBackgroundColour (backgroundColour_); setBackgroundColour (backgroundColour_);
const Rectangle mainMonArea (Desktop::getInstance().getMainMonitorArea());
defaultConstrainer.setSizeLimits (200, 200,
mainMonArea.getWidth(),
mainMonArea.getHeight());
defaultConstrainer.setMinimumOnscreenAmounts (0x10000, 16, 24, 16); defaultConstrainer.setMinimumOnscreenAmounts (0x10000, 16, 24, 16);
lastNonFullScreenPos.setBounds (50, 50,
defaultConstrainer.getMinimumWidth(),
defaultConstrainer.getMinimumHeight());
lastNonFullScreenPos.setBounds (50, 50, 256, 256);
if (addToDesktop_) if (addToDesktop_)
Component::addToDesktop (getDesktopWindowStyleFlags()); Component::addToDesktop (getDesktopWindowStyleFlags());
@@ -258,7 +250,10 @@ void ResizableWindow::setResizeLimits (const int newMinimumWidth,
const int newMaximumHeight) throw() const int newMaximumHeight) throw()
{ {
// if you've set up a custom constrainer then these settings won't have any effect.. // if you've set up a custom constrainer then these settings won't have any effect..
jassert (constrainer == &defaultConstrainer);
jassert (constrainer == &defaultConstrainer || constrainer == 0);
if (constrainer == 0)
setConstrainer (&defaultConstrainer);
defaultConstrainer.setSizeLimits (newMinimumWidth, newMinimumHeight, defaultConstrainer.setSizeLimits (newMinimumWidth, newMinimumHeight,
newMaximumWidth, newMaximumHeight); newMaximumWidth, newMaximumHeight);


Loading…
Cancel
Save