2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2009-2022 Transmission authors and contributors.
|
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2009-08-29 20:28:52 +00:00
|
|
|
|
|
|
|
#import "NSApplicationAdditions.h"
|
|
|
|
|
|
|
|
@implementation NSApplication (NSApplicationAdditions)
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (BOOL)isOnMojaveOrBetter
|
2018-12-21 21:39:47 +00:00
|
|
|
{
|
|
|
|
return floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_13;
|
|
|
|
}
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (BOOL)isDarkMode
|
2018-12-21 21:39:47 +00:00
|
|
|
{
|
2021-08-15 09:41:48 +00:00
|
|
|
if (@available(macOS 10.14, *))
|
|
|
|
{
|
2018-12-21 21:39:47 +00:00
|
|
|
return [self.effectiveAppearance.name isEqualToString:NSAppearanceNameDarkAqua];
|
2021-08-15 09:41:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-21 21:39:47 +00:00
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-29 20:28:52 +00:00
|
|
|
@end
|