Add WindowFullscreenButtonHint.

Adds the fullscreen button on Mac OS X. Has no effect
on other platforms. Regarding the name I dropped the
"Mac" prefix (like MacWindowToolBarButtonHint). Other
platforms can use and we don't want to accumulate "Mac"
API's.

Change logic in QCocoaWindow check for this flag instead
of using WindowsMaximizebutton.

Change-Id: I9f2db75e8e71b3da36777c7e48852eda3ce9d534
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
Morten Johan Sørvig 2012-11-05 22:20:47 +01:00 committed by The Qt Project
parent a7647939f1
commit dc2fd227ab
3 changed files with 8 additions and 6 deletions

View File

@ -311,7 +311,8 @@ public:
BypassGraphicsProxyWidget = 0x20000000,
WindowOkButtonHint = 0x00080000,
WindowCancelButtonHint = 0x00100000,
NoDropShadowWindowHint = 0x40000000
NoDropShadowWindowHint = 0x40000000,
WindowFullscreenButtonHint = 0x80000000
};
Q_DECLARE_FLAGS(WindowFlags, WindowType)

View File

@ -1991,6 +1991,8 @@
\value MacWindowToolBarButtonHint On Mac OS X adds a tool bar button (i.e.,
the oblong button that is on the top right of windows that have toolbars).
\value WindowFullscreenButtonHint On Mac OS X adds a fullscreen button.
\value BypassGraphicsProxyWidget Prevents the window and its children from
automatically embedding themselves into a QGraphicsProxyWidget if the
parent widget is already embedded. You can set this flag if you

View File

@ -684,11 +684,10 @@ NSWindow * QCocoaWindow::createNSWindow()
setWindowShadow(flags);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
// All windows with the WindowMaximizeButtonHint set also get a full-screen button.
if (flags & Qt::WindowMaximizeButtonHint)
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
if (flags & Qt::WindowFullscreenButtonHint)
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
#endif
createdWindow = window;