Mercurial > minori
diff src/sys/osx/dark_theme.mm @ 5:51ae25154b70
Fix OS X support code
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sat, 12 Aug 2023 13:10:34 -0400 |
parents | 23d0d9319a00 |
children | 5c0397762b53 |
line wrap: on
line diff
--- a/src/sys/osx/dark_theme.mm Sat Aug 12 12:08:16 2023 -0400 +++ b/src/sys/osx/dark_theme.mm Sat Aug 12 13:10:34 2023 -0400 @@ -3,12 +3,15 @@ bool osx::DarkThemeAvailable() { - return (__builtin_available(macOS 10.14, *)) ? true : false; + if (@available(macOS 10.14, *)) + return true; + else + return false; } bool osx::IsInDarkTheme() { - if (__builtin_available(macOS 10.14, *)) + if (@available(macOS 10.14, *)) { auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames: @[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]]; @@ -20,7 +23,7 @@ void osx::SetToDarkTheme() { // https://stackoverflow.com/questions/55925862/how-can-i-set-my-os-x-application-theme-in-code - if (__builtin_available(macOS 10.14, *)) + if (@available(macOS 10.14, *)) { [NSApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]]; } @@ -37,7 +40,7 @@ void osx::SetToAutoTheme() { - if (__builtin_available(macOS 10.14, *)) + if (@available(macOS 10.14, *)) { [NSApp setAppearance:nil]; }