1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 07:39:42 +02:00

Allow small color differences

Makes the theme respond better to system colors

Signed-off-by: akleja <storspov@gmail.com>
This commit is contained in:
akleja 2021-08-04 17:43:04 +02:00 committed by Panagiotis Vasilopoulos
parent c3c5765a92
commit cc7c659d6e
No known key found for this signature in database
GPG Key ID: FD806FDB3B2C5270

View File

@ -353,18 +353,12 @@ void ThemeBase::RecolourTheme()
#else
wxColour To = wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE );
#endif
// only recolour if recolouring is slight.
int d = ColourDistance( From, To );
// Don't recolour if difference is too big.
int d = ColourDistance( From, To );
if( d > 120 )
return;
// A minor tint difference from standard does not need
// to be recouloured either. Includes case of d==0 which is nothing
// needs to be done.
if( d < 40 )
return;
Colour( clrMedium ) = To;
RecolourBitmap( bmpUpButtonLarge, From, To );