Struggling with Dark mode in Windows.
Or rather, how to force light mode when Windows is dark Mode.
I can set ‘Supports Dark Mode’ in the IDE - its a constant
When set, some (but not all) controls work in dark mode. Tab panels, for example, always show up as light mode, meaning that labels on them having turned to white, are unreadable.
I have custom controls and have to detect and react manually there.
Heres the question:
On Mac, with the IDE set to ‘No’, App Wrapper can set it to be yes in a post process step.
Is there a way to do this to a compiled Windows app?
So that I can allow it to do dark mode, with all my workarounds,
or force Light mode even in a Dark Mode windows. (Windows itself has nothing - all the online advice about forcing light/dark mode assume that the apps are UWE apps and have their own preferences)
Some file in resources/ an ini file… anything?
I’d go for an “opt in for Darkmode” for your Windows users.
See this example project: GitHub - jo-tools/app-appearance: Xojo example project: App Appearance
DarkMode on Windows is… not that good - at least not for Win32 Apps/Controls, which is what Xojo is currently using. For that reason it is best practice to explizitly allow the user to Opt-in
for DarkMode support of your application. Many Windows users love to have their system setting to have dark appearance in apps, but might dislike that in Win32-apps.
Starting with Xojo 2021r3, Xojo supports DarkMode for TargetWindows
. This example project shows how to allow the users to Opt-in
for DarkMode support, because Xojo by default always uses the system settings.
Note: Unlike macOS, you can never have the application show in DarkMode on if Windows app appearance setting is ‘Light Mode’.
1 Like
Or read this one :Welcome to the Dark Side of Windows – Xojo Programming Blog
For additional capabilities, you can disable dark mode theming (even when you have the dark mode support enabled) in your app by setting up the XOJO_WIN32_DARKMODE_DISABLED environment variable (either set to “true” or “1”) in your App.Opening event.
…I just can’t find that information on https://documentation.xojo.com
2 Likes