JBR-3327 [jbr-dev] Adjust mac window appearance according to AppleInterfaceStyle property

Set window appearance according to AppleInterfaceStyle default

(cherry picked from commit ffe5b5a504)
This commit is contained in:
Alexey Ushakov
2021-04-16 22:39:46 +03:00
committed by jbrbot
parent 27cee33a80
commit a3992dccac

View File

@@ -1131,6 +1131,14 @@ JNI_COCOA_ENTER(env);
window.styleBits = newBits;
NSString *uiStyle = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
if ([@"Dark" isEqualToString: uiStyle]) {
[nsWindow setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
} else {
[nsWindow setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantLight]];
}
if (resized) {
[window _deliverMoveResizeEvent];
}