Improve dark mode detection in wxMSW

Use the registry key corresponding to the selection of "Light" or "Dark"
for the "Colors" in the "Settings" applet, see

https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application/

Closes #22020.
This commit is contained in:
QuentinC
2022-01-15 10:51:41 +01:00
committed by Vadim Zeitlin
parent aae203c7b5
commit 622a2f9d60
2 changed files with 28 additions and 1 deletions

View File

@@ -75,12 +75,17 @@ wxString wxSystemAppearance::GetName() const
return wxString();
}
#endif // !__WXOSX__
// These ports implement this function using platform-specific API.
#if !defined(__WXOSX__) && !defined(__WXMSW__)
bool wxSystemAppearance::IsDark() const
{
return IsUsingDarkBackground();
}
#endif // !__WXOSX__
#endif // !__WXOSX__ && !__WXMSW__
bool wxSystemAppearance::IsUsingDarkBackground() const
{