but how can I determine what the current SYSTEM level darkmode is?
obviously the app (using above, only indicates ITS mode, not the mode of anything else)
And I can’t cache the value before changing the app level, since the system can be changed at any point during the apps lifetime
NSApp.Appearance only checks the apps current state
Not the systems so if you set the app to run in light and the system is set to dark it would be wrong (or vice versa)
I wonder if you can read the system preference using UserDefaults to access the system domain ?
Using defaults read
when the system is in dark mode you find
"Apple Global Domain" = {
AppleInterfaceStyle = Dark;
}
In light mode that key is not there
Perhaps just reading for that key will suffice since user defaults should use the entire search path
Like
Now this has me questioning my entire approach… So I’ll ask opinions
I am creating an IDE. Right now the APP is either light/dark based on an in-App setting, making it independent of the system settings. The idea was to allow the developer to visualize the layout in either mode with out disrupting the system.
So… should I
leave it as is, and the app itself decides which mode [Light|Dark]
remove it, and tie to the system level, and change via System Prefs only
add a 3rd option so it would be either #1 or #2 [Light|Auto|Dark]
I find it particularly nice to be able switch the mode of an App independent from the system preferences. I like some apps more in dark, some (like browsers) more in light. Those apps I’m aware of being able to change the mode themselves, are offering both: