mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
parent
e9080b6a17
commit
7da9090569
7 changed files with 46 additions and 14 deletions
|
|
@ -867,14 +867,14 @@ public:
|
|||
return minimised;
|
||||
}
|
||||
|
||||
void setFullScreen (bool shouldBeFullScreen)
|
||||
void setFullScreen (const bool shouldBeFullScreen)
|
||||
{
|
||||
Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising)
|
||||
|
||||
setMinimised (false);
|
||||
|
||||
if (fullScreen != shouldBeFullScreen)
|
||||
{
|
||||
Rectangle r (lastNonFullscreenBounds);
|
||||
|
||||
if (shouldBeFullScreen)
|
||||
r = Desktop::getInstance().getMainMonitorArea();
|
||||
|
||||
|
|
|
|||
|
|
@ -571,12 +571,12 @@ public:
|
|||
{
|
||||
if (! isSharedWindow)
|
||||
{
|
||||
Rectangle r (lastNonFullscreenBounds);
|
||||
|
||||
setMinimised (false);
|
||||
|
||||
if (fullScreen != shouldBeFullScreen)
|
||||
{
|
||||
Rectangle r (lastNonFullscreenBounds);
|
||||
|
||||
if (shouldBeFullScreen)
|
||||
r = Desktop::getInstance().getMainMonitorArea();
|
||||
|
||||
|
|
|
|||
|
|
@ -731,15 +731,17 @@ public:
|
|||
|
||||
if (! fullScreen)
|
||||
{
|
||||
const Rectangle boundsCopy (lastNonFullscreenBounds);
|
||||
|
||||
if (hasTitleBar())
|
||||
ShowWindow (hwnd, SW_SHOWNORMAL);
|
||||
|
||||
if (! lastNonFullscreenBounds.isEmpty())
|
||||
if (! boundsCopy.isEmpty())
|
||||
{
|
||||
setBounds (lastNonFullscreenBounds.getX(),
|
||||
lastNonFullscreenBounds.getY(),
|
||||
lastNonFullscreenBounds.getWidth(),
|
||||
lastNonFullscreenBounds.getHeight(),
|
||||
setBounds (boundsCopy.getX(),
|
||||
boundsCopy.getY(),
|
||||
boundsCopy.getWidth(),
|
||||
boundsCopy.getHeight(),
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -465,12 +465,14 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
|
|||
bool wasFullscreen = false;
|
||||
bool wasMinimised = false;
|
||||
ComponentBoundsConstrainer* currentConstainer = 0;
|
||||
Rectangle oldNonFullScreenBounds;
|
||||
|
||||
if (peer != 0)
|
||||
{
|
||||
wasFullscreen = peer->isFullScreen();
|
||||
wasMinimised = peer->isMinimised();
|
||||
currentConstainer = peer->getConstrainer();
|
||||
oldNonFullScreenBounds = peer->getNonFullScreenBounds();
|
||||
|
||||
removeFromDesktop();
|
||||
}
|
||||
|
|
@ -492,7 +494,10 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
|
|||
peer->setVisible (isVisible());
|
||||
|
||||
if (wasFullscreen)
|
||||
{
|
||||
peer->setFullScreen (true);
|
||||
peer->setNonFullScreenBounds (oldNonFullScreenBounds);
|
||||
}
|
||||
|
||||
if (wasMinimised)
|
||||
peer->setMinimised (true);
|
||||
|
|
|
|||
|
|
@ -643,6 +643,16 @@ void ComponentPeer::handleScreenSizeChange()
|
|||
handleMovedOrResized();
|
||||
}
|
||||
|
||||
void ComponentPeer::setNonFullScreenBounds (const Rectangle& newBounds) throw()
|
||||
{
|
||||
lastNonFullscreenBounds = newBounds;
|
||||
}
|
||||
|
||||
const Rectangle& ComponentPeer::getNonFullScreenBounds() const throw()
|
||||
{
|
||||
return lastNonFullscreenBounds;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentPeer::handleFilesDropped (int x, int y, const StringArray& files)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -174,6 +174,12 @@ public:
|
|||
/** True if the window is currently full-screen. */
|
||||
virtual bool isFullScreen() const = 0;
|
||||
|
||||
/** Sets the size to restore to if fullscreen mode is turned off. */
|
||||
void setNonFullScreenBounds (const Rectangle& newBounds) throw();
|
||||
|
||||
/** Returns the size to restore to if fullscreen mode is turned off. */
|
||||
const Rectangle& getNonFullScreenBounds() const throw();
|
||||
|
||||
/** Attempts to change the icon associated with this window.
|
||||
*/
|
||||
virtual void setIcon (const Image& newIcon) = 0;
|
||||
|
|
|
|||
|
|
@ -477,13 +477,22 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s)
|
|||
return false;
|
||||
|
||||
lastNonFullScreenPos = r;
|
||||
|
||||
if (isOnDesktop())
|
||||
{
|
||||
ComponentPeer* const peer = getPeer();
|
||||
|
||||
if (peer != 0)
|
||||
peer->setNonFullScreenBounds (r);
|
||||
}
|
||||
|
||||
setFullScreen (fs);
|
||||
|
||||
if (! fs)
|
||||
setBoundsConstrained (lastNonFullScreenPos.getX(),
|
||||
lastNonFullScreenPos.getY(),
|
||||
lastNonFullScreenPos.getWidth(),
|
||||
lastNonFullScreenPos.getHeight());
|
||||
setBoundsConstrained (r.getX(),
|
||||
r.getY(),
|
||||
r.getWidth(),
|
||||
r.getHeight());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue