electron/atom/browser/api/atom_api_system_preferences_mac.mm

24 lines
512 B
Text
Raw Normal View History

2016-04-24 12:13:46 +00:00
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_system_preferences.h"
#import <Cocoa/Cocoa.h>
2016-04-24 12:13:46 +00:00
namespace atom {
namespace api {
#if defined(OS_MACOSX)
bool SystemPreferences::IsDarkMode() {
NSString* mode = [[NSUserDefaults standardUserDefaults]
stringForKey:@"AppleInterfaceStyle"];
return [mode isEqualToString:@"Dark"];
}
#endif
2016-04-24 12:13:46 +00:00
} // namespace api
} // namespace atom