diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2017-07-13 16:34:32 -0700 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2017-07-13 16:36:10 -0700 |
commit | d38fe875c7850ca2c6ca28f91e94ae276735fac8 (patch) | |
tree | e5c92cef74e0853490d77cf0139b23f00d548a6e /src/plugins/platforms/cocoa | |
parent | ac4e848c9802377b7c4ff673180f28b9ca76b746 (diff) | |
parent | 627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
src/widgets/widgets/qmainwindowlayout.cpp
Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/cocoa.pro | 7 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoafontdialoghelper.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 4 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoatheme.mm | 16 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnswindowdelegate.mm | 16 |
5 files changed, 34 insertions, 12 deletions
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index f48f9ccf30..1e6ea70161 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -21,7 +21,6 @@ OBJECTIVE_SOURCES += main.mm \ qmultitouch_mac.mm \ qcocoaaccessibilityelement.mm \ qcocoaaccessibility.mm \ - qcocoafontdialoghelper.mm \ qcocoacursor.mm \ qcocoaclipboard.mm \ qcocoadrag.mm \ @@ -55,7 +54,6 @@ HEADERS += qcocoaintegration.h \ qmultitouch_mac_p.h \ qcocoaaccessibilityelement.h \ qcocoaaccessibility.h \ - qcocoafontdialoghelper.h \ qcocoacursor.h \ qcocoaclipboard.h \ qcocoadrag.h \ @@ -111,6 +109,11 @@ qtHaveModule(widgets) { HEADERS += qcocoafiledialoghelper.h } + qtConfig(fontdialog) { + SOURCES += qcocoafontdialoghelper.mm + HEADERS += qcocoafontdialoghelper.h + } + QT += widgets-private printsupport-private } diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h index 8b05cb7933..c3fad7cfd6 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h @@ -41,8 +41,11 @@ #define QCOCOAFONTDIALOGHELPER_H #include <QObject> +#include <QtWidgets/qtwidgetsglobal.h> #include <qpa/qplatformdialoghelper.h> +QT_REQUIRE_CONFIG(fontdialog); + QT_BEGIN_NAMESPACE class QCocoaFontDialogHelper : public QPlatformFontDialogHelper diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index e4b796dcde..dbd7e90dba 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_FONTDIALOG - #include <QtCore/qtimer.h> #include <QtGui/qfontdatabase.h> #include <qpa/qplatformtheme.h> @@ -402,5 +400,3 @@ QFont QCocoaFontDialogHelper::currentFont() const } QT_END_NAMESPACE - -#endif // QT_NO_FONTDIALOG diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index a6104d86cc..fd627e3796 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -44,8 +44,6 @@ #include <QtCore/QVariant> -#include "qcocoacolordialoghelper.h" -#include "qcocoafontdialoghelper.h" #include "qcocoasystemsettings.h" #include "qcocoasystemtrayicon.h" #include "qcocoamenuitem.h" @@ -64,9 +62,15 @@ #ifdef QT_WIDGETS_LIB #include <QtWidgets/qtwidgetsglobal.h> +#if QT_CONFIG(colordialog) +#include "qcocoacolordialoghelper.h" +#endif #if QT_CONFIG(filedialog) #include "qcocoafiledialoghelper.h" #endif +#if QT_CONFIG(fontdialog) +#include "qcocoafontdialoghelper.h" +#endif #endif #include <Carbon/Carbon.h> @@ -130,11 +134,11 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const { if (dialogType == QPlatformTheme::FileDialog) return true; -#if QT_CONFIG(colordialog) +#if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog) if (dialogType == QPlatformTheme::ColorDialog) return true; #endif -#ifndef QT_NO_FONTDIALOG +#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog) if (dialogType == QPlatformTheme::FontDialog) return true; #endif @@ -148,11 +152,11 @@ QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialo case QPlatformTheme::FileDialog: return new QCocoaFileDialogHelper(); #endif -#if QT_CONFIG(colordialog) +#if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog) case QPlatformTheme::ColorDialog: return new QCocoaColorDialogHelper(); #endif -#ifndef QT_NO_FONTDIALOG +#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog) case QPlatformTheme::FontDialog: return new QCocoaFontDialogHelper(); #endif diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index ce74aa9973..e5041fb863 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -78,6 +78,22 @@ return m_cocoaWindow->screen()->availableGeometry().toCGRect(); } +#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11) +/* + AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame + from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting + in black bars on top and bottom of the window. By implementing the following + method, AppKit will choose that instead, and resolve the right fullscreen + geometry. +*/ +- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize +{ + Q_UNUSED(window); + Q_ASSERT(NSEqualSizes(m_cocoaWindow->screen()->geometry().size().toCGSize(), proposedSize)); + return proposedSize; +} +#endif + - (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu { Q_UNUSED(window); |