IDEToLightMode (and of course IDEToDarkMode) are scripts that I've added to the Home stack of the modded IDE that I've been working on (and which is now the target for this library), these scripts further modify the IDE stacks in memory, this is because some IDE stacks do not look correct when simply setting a dark appearance on the stack window's NSWindow.appearance property. To look correct in darkmode, sometimes graphics, icons and text needs to changed to be white on dark or dark on light to be readable. If you set your text fields to "default"/empty for text and background color, then those should automagically get flipped dark/light by the OS (inherits it's property from NSApplication obj / macOS). You may need to set some colors in your own darkmode scripts or adjust some graphics if you plan on using this. You'll see what I mean if you browse some stacks with the IDE in darkMode.Klaus wrote: ↑Fri May 06, 2022 5:05 pmFive minutes later...
OK, changing the stack from "System Window" to "toplevel" cured the crash and "dark mode" works as advertized!?
Great, thanks a LOT!
However the window title stays black after setting to "light" again with -> setAppToLightMode
Using "setWindowToLightMode the windowID of this stack" makes if white again.
But this throws an error: IDEToLightMode -> in stack "macOS Tools Tester"
"System Window" not compatible... I'll have to look into this further and do some testing. I have not had any crashes using this, and now tested on 12.3, but again I'm using a modded IDE now and it's fairly well modified.
NOTE: that the setLCtoDarkMode handler was a proof of concept at first, because without modifying some of the IDE stacks, it wasn't all that usable for the IDE itself (but I've been working on those IDE stack mods too). I'm not sure what name I settled on, setAppToDarkMode, I think. What this handler does is sets the .appearance property on the top level NSApplication object instead of an NSWindow object, then all of an app's windows inherit that appearance (unless something changes again). Anyway this should be generally useful for standalones as long as you design you stacks with the graphical constraints in mind.
As I mentioned to you on FB I have a couple of other NSWindow related handlers that could be useful on macOS, such as that "blurred transparency background" material, as well s the newer the "Unified Titlebar" macOS window style, which I intend to add to the library eventually.