pgadmin4/runtime/macos.mm
Dave Page 41be5479af Added dark mode support for the configuration dialog on Windows/macOS runtime. Fixes #4292
Detects dark mode at server start and styles the runtime accordingly.

Patch modified by: Neel Patel
2020-04-13 13:22:00 +05:30

23 lines
696 B
Plaintext

//////////////////////////////////////////////////////////////////////////
//
// 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>
// Detect if we're running in Dark mode
bool IsDarkMode() {
if (@available(macOS 10.14, *)) {
NSString *interfaceStyle = [NSUserDefaults.standardUserDefaults valueForKey:@"AppleInterfaceStyle"];
return [interfaceStyle isEqualToString:@"Dark"];
} else {
return NO;
}
}