1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 15:20:15 +02:00

Fix posterisation. Add blend themes option.

Posterisation was caused by having a bright theme cache and using a darker theme (in linux) so the light colours 'got stretched' and showed up the relatively few distinct values there.  So the Classic theme is now darker, and we expect (on Windows) that it will be recoloured to windows lighter colours.
This commit is contained in:
James Crook 2017-04-24 17:46:02 +01:00
parent 94d8c2cff7
commit d0bafebfdf
3 changed files with 3578 additions and 3545 deletions

File diff suppressed because it is too large Load Diff

View File

@ -367,15 +367,15 @@ void ThemeBase::RecolourTheme()
return; return;
Colour( clrMedium ) = To; Colour( clrMedium ) = To;
RecolourBitmap( bmpUpButtonLarge, From, To ); RecolourBitmap( bmpUpButtonLarge, From, To );
RecolourBitmap( bmpDownButtonLarge, From, To ); RecolourBitmap( bmpDownButtonLarge, From, To );
RecolourBitmap( bmpHiliteButtonLarge, From, To ); RecolourBitmap( bmpHiliteButtonLarge, From, To );
RecolourBitmap( bmpUpButtonSmall, From, To ); RecolourBitmap( bmpUpButtonSmall, From, To );
RecolourBitmap( bmpDownButtonSmall, From, To ); RecolourBitmap( bmpDownButtonSmall, From, To );
RecolourBitmap( bmpHiliteButtonSmall, From, To ); RecolourBitmap( bmpHiliteButtonSmall, From, To );
// Colour( clrTrackInfo ) = To;
// RecolourBitmap( bmpUpButtonExpand, From, To ); Colour( clrTrackInfo ) = To;
RecolourBitmap( bmpUpButtonExpand, From, To );
} }
wxImage ThemeBase::MaskedImage( char const ** pXpm, char const ** pMask ) wxImage ThemeBase::MaskedImage( char const ** pXpm, char const ** pMask )
@ -882,7 +882,8 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
// ImageCache.InitAlpha(); // ImageCache.InitAlpha();
// } // }
bRecolourOnLoad = false; gPrefs->Read(wxT("/GUI/BlendThemes"), &bRecolourOnLoad, true);
if( type == themeFromFile ) if( type == themeFromFile )
{ {
const wxString &FileName = FileNames::ThemeCachePng(); const wxString &FileName = FileNames::ThemeCachePng();
@ -914,12 +915,10 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
switch( type ){ switch( type ){
default: default:
case themeClassic : case themeClassic :
bRecolourOnLoad = true;
ImageSize = sizeof(ClassicImageCacheAsData); ImageSize = sizeof(ClassicImageCacheAsData);
pImage = (char *)ClassicImageCacheAsData; pImage = (char *)ClassicImageCacheAsData;
break; break;
case themeLight : case themeLight :
bRecolourOnLoad = true;
ImageSize = sizeof(LightImageCacheAsData); ImageSize = sizeof(LightImageCacheAsData);
pImage = (char *)LightImageCacheAsData; pImage = (char *)LightImageCacheAsData;
break; break;
@ -932,6 +931,7 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
pImage = (char *)HiContrastImageCacheAsData; pImage = (char *)HiContrastImageCacheAsData;
break; break;
} }
wxMemoryInputStream InternalStream( pImage, ImageSize ); wxMemoryInputStream InternalStream( pImage, ImageSize );
if( !ImageCache.LoadFile( InternalStream, wxBITMAP_TYPE_PNG )) if( !ImageCache.LoadFile( InternalStream, wxBITMAP_TYPE_PNG ))

View File

@ -188,7 +188,9 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
S.TieCheckBox(_("Re&tain labels if selection snaps to a label edge"), S.TieCheckBox(_("Re&tain labels if selection snaps to a label edge"),
wxT("/GUI/RetainLabels"), wxT("/GUI/RetainLabels"),
false); false);
S.TieCheckBox(_("B&lend System and Audacity Theme"),
wxT("/GUI/BlendThemes"),
true);
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
S.TieCheckBox(_("&Display a mono channel as virtual stereo"), S.TieCheckBox(_("&Display a mono channel as virtual stereo"),
wxT("/GUI/MonoAsVirtualStereo"), wxT("/GUI/MonoAsVirtualStereo"),