Enable icon themes for Windows

Windows 10 "dark mode" is not supported and likely won't be,
but high-contrast mode and manual color theme editing is still
possible.
This commit is contained in:
Jon Evans 2021-03-14 15:39:19 -04:00
parent cb451dc4b2
commit a9f86c6f3d
2 changed files with 9 additions and 2 deletions

View File

@ -345,7 +345,7 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes, configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
&m_DrawBoundingBoxes, false ) ); &m_DrawBoundingBoxes, false ) );
#ifdef __WXGTK__ #if defined( __WXGTK__ ) || defined( __WXMSW__ )
bool defaultDarkMode = true; bool defaultDarkMode = true;
#else #else
bool defaultDarkMode = false; bool defaultDarkMode = false;

View File

@ -53,7 +53,14 @@ bool KIPLATFORM::UI::IsDarkTheme()
return ( val == 0 ); return ( val == 0 );
#else #else
return false; wxColour bg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
// Weighted W3C formula
double brightness = ( bg.Red() / 255.0 ) * 0.299 +
( bg.Green() / 255.0 ) * 0.587 +
( bg.Blue() / 255.0 ) * 0.117;
return brightness < 0.5;
#endif #endif
} }