adam-gui/vendor/fyne.io/fyne/v2/app/app_desktop_darwin.m

19 lines
529 B
Mathematica
Raw Permalink Normal View History

2024-04-29 19:13:50 +02:00
//go:build !ci && !ios
// +build !ci,!ios
extern void themeChanged();
#import <Foundation/Foundation.h>
bool isDarkMode() {
NSString *style = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
return [@"Dark" isEqualToString:style];
}
void watchTheme() {
[[NSDistributedNotificationCenter defaultCenter] addObserverForName:@"AppleInterfaceThemeChangedNotification" object:nil queue:nil
usingBlock:^(NSNotification *note) {
themeChanged(); // calls back into Go
}];
}