2020-04-13 02:52:00 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
|
|
|
// Copyright (C) 2013 - 2020, The pgAdmin Development Team
|
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
// macos.mm - macOS-specific Objective-C/C++ functions
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2020-05-12 06:52:04 -05:00
|
|
|
#import <Availability.h>
|
2020-04-13 02:52:00 -05:00
|
|
|
|
|
|
|
// Detect if we're running in Dark mode
|
|
|
|
bool IsDarkMode() {
|
2020-05-12 06:52:04 -05:00
|
|
|
#ifdef __MAC_10_14
|
2020-04-13 02:52:00 -05:00
|
|
|
if (@available(macOS 10.14, *)) {
|
|
|
|
NSString *interfaceStyle = [NSUserDefaults.standardUserDefaults valueForKey:@"AppleInterfaceStyle"];
|
|
|
|
return [interfaceStyle isEqualToString:@"Dark"];
|
|
|
|
} else {
|
|
|
|
return NO;
|
|
|
|
}
|
2020-05-12 06:52:04 -05:00
|
|
|
#else
|
|
|
|
return NO;
|
|
|
|
#endif
|
2020-04-13 02:52:00 -05:00
|
|
|
}
|