mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Changes to ResizableWindow to avoid flicker when first adding to desktop.
This commit is contained in:
parent
b05c8413cf
commit
329127ad87
4 changed files with 14 additions and 13 deletions
|
|
@ -90,12 +90,6 @@ int ResizableWindow::getDesktopWindowStyleFlags() const
|
|||
return styleFlags;
|
||||
}
|
||||
|
||||
void ResizableWindow::addToDesktop()
|
||||
{
|
||||
Component::addToDesktop (ResizableWindow::getDesktopWindowStyleFlags());
|
||||
setDropShadowEnabled (isDropShadowEnabled()); // force an update to clear away any fake shadows if necessary.
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ResizableWindow::clearContentComponent()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -189,9 +189,6 @@ public:
|
|||
*/
|
||||
void setMinimised (bool shouldMinimise);
|
||||
|
||||
/** Adds the window to the desktop using the default flags. */
|
||||
void addToDesktop();
|
||||
|
||||
//==============================================================================
|
||||
/** Returns a string which encodes the window's current size and position.
|
||||
|
||||
|
|
|
|||
|
|
@ -238,11 +238,11 @@ void TopLevelWindow::setDropShadowEnabled (const bool useShadow)
|
|||
}
|
||||
}
|
||||
|
||||
void TopLevelWindow::setUsingNativeTitleBar (const bool useNativeTitleBar_)
|
||||
void TopLevelWindow::setUsingNativeTitleBar (const bool shouldUseNativeTitleBar)
|
||||
{
|
||||
if (useNativeTitleBar != useNativeTitleBar_)
|
||||
if (useNativeTitleBar != shouldUseNativeTitleBar)
|
||||
{
|
||||
useNativeTitleBar = useNativeTitleBar_;
|
||||
useNativeTitleBar = shouldUseNativeTitleBar;
|
||||
recreateDesktopWindow();
|
||||
sendLookAndFeelChange();
|
||||
}
|
||||
|
|
@ -257,6 +257,13 @@ void TopLevelWindow::recreateDesktopWindow()
|
|||
}
|
||||
}
|
||||
|
||||
void TopLevelWindow::addToDesktop()
|
||||
{
|
||||
shadower = nullptr;
|
||||
Component::addToDesktop (getDesktopWindowStyleFlags());
|
||||
setDropShadowEnabled (isDropShadowEnabled()); // force an update to clear away any fake shadows if necessary.
|
||||
}
|
||||
|
||||
void TopLevelWindow::addToDesktop (int windowStyleFlags, void* nativeWindowToAttachTo)
|
||||
{
|
||||
/* It's not recommended to change the desktop window flags directly for a TopLevelWindow,
|
||||
|
|
@ -330,7 +337,7 @@ TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() noexcept
|
|||
int numTWLParents = 0;
|
||||
|
||||
for (const Component* c = tlw->getParentComponent(); c != nullptr; c = c->getParentComponent())
|
||||
if (dynamic_cast <const TopLevelWindow*> (c) != nullptr)
|
||||
if (dynamic_cast<const TopLevelWindow*> (c) != nullptr)
|
||||
++numTWLParents;
|
||||
|
||||
if (bestNumTWLParents < numTWLParents)
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@ public:
|
|||
*/
|
||||
static TopLevelWindow* getActiveTopLevelWindow() noexcept;
|
||||
|
||||
/** Adds the window to the desktop using the default flags. */
|
||||
void addToDesktop();
|
||||
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
|
|
@ -149,6 +151,7 @@ protected:
|
|||
|
||||
private:
|
||||
friend class TopLevelWindowManager;
|
||||
friend class ResizableWindow;
|
||||
bool useDropShadow, useNativeTitleBar, isCurrentlyActive;
|
||||
ScopedPointer<DropShadower> shadower;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue