Julien Lebosquain
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
13 additions and
2 deletions
-
native/Avalonia.Native/src/OSX/PlatformSettings.mm
|
|
|
@ -45,9 +45,20 @@ public: |
|
|
|
{ |
|
|
|
@autoreleasepool |
|
|
|
{ |
|
|
|
if (@available(macOS 10.14, *)) |
|
|
|
if (@available(macOS 11.0, *)) |
|
|
|
{ |
|
|
|
__block NSColor* color; |
|
|
|
[[NSApp effectiveAppearance] performAsCurrentDrawingAppearance:^{ |
|
|
|
color = [[NSColor controlAccentColor] colorUsingColorSpace:NSColorSpace.sRGBColorSpace]; |
|
|
|
}]; |
|
|
|
return to_argb(color); |
|
|
|
} |
|
|
|
else if (@available(macOS 10.14, *)) |
|
|
|
{ |
|
|
|
auto color = [NSColor controlAccentColor]; |
|
|
|
auto previousAppearance = NSAppearance.currentAppearance; |
|
|
|
NSAppearance.currentAppearance = [NSApp effectiveAppearance]; |
|
|
|
auto color = [[NSColor controlAccentColor] colorUsingColorSpace:NSColorSpace.sRGBColorSpace]; |
|
|
|
NSAppearance.currentAppearance = previousAppearance; |
|
|
|
return to_argb(color); |
|
|
|
} |
|
|
|
else |
|
|
|
|