Use isOperatingSystemAtLeastVersion: to check for 10.10

The method wasn’t public before 10.10 but since we need to check for 10.10 we can simply conclude that lack of this method means that we are not running on 10.10.
This commit is contained in:
Allan Odgaard
2015-08-05 12:29:33 +02:00
parent c75b89c048
commit d1ed42fef1
2 changed files with 2 additions and 4 deletions

View File

@@ -1,7 +1,6 @@
#import "OakTabItemView.h"
#import "OakRolloverButton.h"
#import "NSImage Additions.h"
#import <oak/compat.h>
@interface OakTabBarStyle ()
{
@@ -139,7 +138,7 @@
_inactiveTabTextStyles = _activeTabTextStyles.mutableCopy;
_inactiveTabTextStyles[NSForegroundColorAttributeName] = [NSColor colorWithCalibratedWhite:0.5 alpha:1];
if(oak::os_tuple() >= std::make_tuple(10, 10, 0))
if([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:{ 10, 10, 0 }])
{
_selectedTabTextStyles = _activeTabTextStyles.mutableCopy;
_selectedTabTextStyles[NSForegroundColorAttributeName] = [NSColor blackColor];

View File

@@ -3,7 +3,6 @@
#import <OakAppKit/OakTabItemView.h>
#import <OakAppKit/OakUIConstructionFunctions.h>
#import <Preferences/Keys.h>
#import <oak/compat.h>
static NSButton* OakCreateImageButton (NSString* imageName)
{
@@ -47,7 +46,7 @@ static NSPopUpButton* OakCreateFolderPopUpButton ()
NSMutableParagraphStyle* parStyle = [NSMutableParagraphStyle new];
[parStyle setLineBreakMode:NSLineBreakByTruncatingMiddle];
if(oak::os_tuple() >= std::make_tuple(10, 10, 0))
if([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:{ 10, 10, 0 }])
{
NSFont* font = [NSFont systemFontOfSize:12];