Hello,
Regarding dark mode, it also have been requested to me by a user.
According to this stack overflow question:
https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application/51336913
I came up with this code:
bool checkDarkMode () {
#ifdef __WIN32
wxRegKey rk(wxRegKey::HKCU,
"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
if (rk.Exists() && rk.HasValue("AppsUseLightTheme")) {
long value = -1;
rk.QueryValue("AppsUseLightTheme", &value);
return value<=0;
}
#endif
return wxSystemSettings::GetAppearance().IsDark();
}
However, this code only does detection. You need to change colors
yourself, and wx is of no help because request system colors keeps
returning normal colors.
This explains why wxSystemSettings::GetAppearance().IsDark() in fact
never work. The window background color is always found to be white.
IN my case, I made it very very simple: if dark mode is detected, I
invert the system colors returned by the regular wxSystemSettings calls,
i.e. 255-red, 255-green, 255-blue. 3D effects are now completely wrong
and have still to be fixed, but globally it works.
BY the way, regarding colors, it would be good if HSL were implemented.
For example:
HSL(240°, 100%, 50%) is blue (= RGB(0, 0, 255)). It would be cool to
have a method like this:
wxColour::FromHSL(240.0f, 1.0f, 0.5f)
When you are partially sighted like me, it's easier to think about
colors in this way...
Have a nice day.