Skip to content

Commit

Permalink
Remove code paths for macOS < 10.11
Browse files Browse the repository at this point in the history
Change-Id: I5ae02d88aa3dcd97d1f2ebf6255a68643e5d6daa
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Gabriel de Dietrich <[email protected]>
Reviewed-by: Konstantin Ritt <[email protected]>
  • Loading branch information
jakepetroules authored and torarnv committed Feb 11, 2018
1 parent 2c9dcfa commit 138a65e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 34 deletions.
16 changes: 3 additions & 13 deletions src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,18 @@

#include <cmath>

#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
#if defined(Q_OS_MACOS)
#import <AppKit/AppKit.h>
#endif

#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
#if defined(QT_PLATFORM_UIKIT)
#import <UIKit/UIKit.h>
#endif

// These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
// but they are not documented and are not in public headers so are private API and exposed
// only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
#define kCTFontWeightUltraLight -0.8
#define kCTFontWeightThin -0.6
#define kCTFontWeightLight -0.4
#define kCTFontWeightRegular 0
#define kCTFontWeightMedium 0.23
#define kCTFontWeightSemibold 0.3
#define kCTFontWeightBold 0.4
#define kCTFontWeightHeavy 0.56
#define kCTFontWeightBlack 0.62
#elif defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
#define kCTFontWeightUltraLight NSFontWeightUltraLight
#define kCTFontWeightThin NSFontWeightThin
#define kCTFontWeightLight NSFontWeightLight
Expand Down
6 changes: 1 addition & 5 deletions src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@ - (id)initWithAcceptMode:
// resetting our mCurrentDir, set the delegate
// here to make sure it gets the correct value.
[mSavePanel setDelegate:self];

#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
if (__builtin_available(macOS 10.11, *))
mOpenPanel.accessoryViewDisclosed = YES;
#endif
mOpenPanel.accessoryViewDisclosed = YES;

if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
[mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];
Expand Down
16 changes: 0 additions & 16 deletions src/plugins/platforms/cocoa/qnswindowdelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,6 @@ - (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)new
return NSRectFromCGRect(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(proposedSize);
Q_ASSERT(window == m_cocoaWindow->nativeWindow());
return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
}
#endif

- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
Q_UNUSED(window);
Expand Down

0 comments on commit 138a65e

Please sign in to comment.