Skip to content
Permalink
Browse files

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

…arlier

(cherry picked from commit b2ba38d)
  • Loading branch information
PeterPetrik authored and wonder-sk committed Nov 12, 2018
1 parent 63b2267 commit ea626b8b5d084301da350a74284a65bfec5a5bd5
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 ea626b8

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