IDE is now in Darkmode

I don’t want the IDE for XOJO to be in dark mode. I want it Light again. Where is this option set. And NO it is not in options on the Windows version.

For some reason setting the XOJO_WIN32_DARKMODE_DISABLED environment variable to “true” in windows doesn’t work even though it’s a working feature to set it in App.Opening as mentioned at the bottom of the page here. This is probably a bug, but it hasn’t been reported yet. I think you’ll have to switch your whole desktop to light mode to get around this at the moment.

  1. Open cmd.exe
  2. Change to the directory of the Xojo IDE, set the environment variable and launch the Xojo IDE:
    c:
    cd "C:\Program Files\Xojo\Xojo 2021r3.1"
    set XOJO_WIN32_DARKMODE_DISABLED=True
    xojo.exe
    
  3. The SplashScreen will still shown in DarkMode, but the IDE will not be in DarkMode.

If you’re doing that, then bear in mind that this environment variable also effects Debug-Runs that you are going to launch via the IDE’s Run Button. So an application with enabled DarkMode support will show in LightMode in a DebugRun, too.

If you don’t want that, then you can either do a “run paused”, and launch the DebugApp.exe from Windows Explorer. That way the environment variable won’t be inherited.
Or add the following line of Code to in App.Opening to get the “default behavior” back in a DebugRun:
System.EnvironmentVariable("XOJO_WIN32_DARKMODE_DISABLED") = "False"
That allows to have the Xojo IDE in LightMode, but develop/test/debug-run an application supporting DarkMode.

Instead of going through cmd.exe to launch the Xojo IDE, you could also write a simple .bat to launch Xojo with a custom environment variable.

1 Like

I had a think about this while I was having dinner. It does work, either… ah there we go, Jurg got it as I was typing :slight_smile: Yes, the lack of spaces between the XOJO_WIN32_DARKMODE_DISABLED=True was the thing that got me, I was putting spaces in.

For example: Create a (text) file XojoInLightMode.bat with the following content:

@echo off
set XOJO_WIN32_DARKMODE_DISABLED=True
start "Xojo 2021r3.1" "C:\Program Files\Xojo\Xojo 2021r3.1\Xojo.exe"

Just keep in mind the effects for Debug Run’s if you’re going to launch the Xojo IDE with this EnvironmentVariable, such as explained above.

Or add it as an Environment Variable in windows

Windows Key+R
SystemPropertiesAdvanced.exe
Environment Variables button
User variables for <username>
New…
XOJO_WIN32_DARKMODE_DISABLED into name
True into value

I haven’t recommended that since it might affect other Xojo built applications, too (which may not be intended) :wink:
That’s why I usually try to limit special settings to just where i want/need them.

Oh… and thanks to Xojo for not setting this environment variable to “false” in the Xojo IDE itself (which would superseed the env-variable before launching the executable), so that we get the possibility to run the IDE in LightMode even if the Windows Theme is set to “dark”.

HI guys, thanks for you input.
But let me be more clear.
I am running windows 10 pro in normal mode, not dark mode. And i dont want to ever run dark mode for anything. It even annoys me when the forum switches to dark mode and I haven’t even asked for it.
So why is the XOJO IDE in darkmode when I haven’t even asked for it or even changed anything in my environment and why cant I change it under options.
Thanks in advance.

That’s odd. Because it should only show dark mode, when you have dark mode enable in Windows.

Anyhow, Xojo should have the preference option to choose it anyway (auto, light and dark).

There are some hacky ways to make it happen, but normally that’s not how Win32 works. Xojo asks the system to draw the control, and it is drawn according to system settings.