Skip to content
Permalink
Browse files

support for compilation on macos10.14, but running on macos10.13 or e…

…arlier
  • Loading branch information
PeterPetrik committed Nov 12, 2018
1 parent 798155c commit b2ba38dfaf56060777d03b9597dc4882c31c6a87
Showing with 14 additions and 4 deletions.
  1. +14 −4 src/native/mac/qgsmacnative.mm
@@ -121,9 +121,19 @@ - ( BOOL )userNotificationCenter:( NSUserNotificationCenter * )center shouldPres

bool QgsMacNative::hasDarkTheme()
{
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
return ( NSApp.effectiveAppearance.name == NSAppearanceNameDarkAqua );
#else
return false;
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14
if (@available(macOS 10.14, *)) {
// compiled on macos 10.14+ AND running on macos 10.14+
// check the settings of effective apperance of the user
return ( NSApp.effectiveAppearance.name == NSAppearanceNameDarkAqua );
} else {
// compiled on macos 10.14+ BUT running on macos 10.13-
// DarkTheme was introduced in MacOS 10.14, fallback to light theme
return false;
}
#endif
// compiled on macos 10.13- AND running anywhere
// NSAppearanceNameDarkAqua is not in SDK headers
// fallback to light theme
return false;
}

0 comments on commit b2ba38d

Please sign in to comment.
You can’t perform that action at this time.