Add Hi-Contrast Theme

This commit is contained in:
James Crook 2017-04-10 12:09:38 +01:00
parent 06816684df
commit a868d0c118
5 changed files with 4064 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@ -201,6 +201,9 @@ static unsigned char LightImageCacheAsData[] = {
static unsigned char ClassicImageCacheAsData[] = {
#include "ClassicThemeAsCeeCode.h"
};
static unsigned char HiContrastImageCacheAsData[] = {
#include "HiContrastThemeAsCeeCode.h"
};
// theTheme is a global variable.
AUDACITY_DLL_API Theme theTheme;
@ -852,6 +855,7 @@ teThemeType ThemeBase::ThemeTypeOfTypeName( const wxString & Name )
aThemes.Add( "classic" );
aThemes.Add( "dark" );
aThemes.Add( "light" );
aThemes.Add( "hi-contrast" );
aThemes.Add( "custom" );
int themeIx = aThemes.Index( Name );
if( themeIx < 0 )
@ -923,6 +927,10 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
ImageSize = sizeof(DarkImageCacheAsData);
pImage = (char *)DarkImageCacheAsData;
break;
case themeHiContrast :
ImageSize = sizeof(HiContrastImageCacheAsData);
pImage = (char *)HiContrastImageCacheAsData;
break;
}
wxMemoryInputStream InternalStream( pImage, ImageSize );

View File

@ -49,6 +49,7 @@ enum teThemeType
themeClassic,
themeDark,
themeLight,
themeHiContrast,
themeFromFile,
};

View File

@ -88,11 +88,13 @@ void GUIPrefs::Populate()
mThemeCodes.Add( wxT("classic") );
mThemeCodes.Add( wxT("light") );
mThemeCodes.Add( wxT("dark") );
mThemeCodes.Add( wxT("hi-contrast") );
mThemeCodes.Add( wxT("custom") );
mThemeChoices.Add( _("Classic") );
mThemeChoices.Add( _("Light") );
mThemeChoices.Add( _("Dark") );
mThemeChoices.Add( _("Hi Contrast") );
mThemeChoices.Add( _("Custom") );
GetRangeChoices(&mRangeChoices, &mRangeCodes);

View File

@ -1372,7 +1372,8 @@ bool NumericTextCtrl::Layout()
mBackgroundBitmap = std::make_unique<wxBitmap>(mWidth + mButtonWidth, mHeight);
memDC.SelectObject(*mBackgroundBitmap);
memDC.SetBrush(*wxLIGHT_GREY_BRUSH);
theTheme.SetBrushColour( Brush, clrTimeBack );
memDC.SetBrush(Brush);
memDC.SetPen(*wxTRANSPARENT_PEN);
memDC.DrawRectangle(0, 0, mWidth + mButtonWidth, mHeight);
@ -1381,13 +1382,13 @@ bool NumericTextCtrl::Layout()
memDC.GetTextExtent(wxT("0"), &strW, &strH);
int labelTop = numberBottom - strH;
memDC.SetTextForeground(*wxBLACK);
memDC.SetTextBackground(*wxLIGHT_GREY);
memDC.SetTextForeground(theTheme.Colour( clrTimeFont ));
memDC.SetTextBackground(theTheme.Colour( clrTimeBack ));
memDC.DrawText(mPrefix, mBorderLeft, labelTop);
theTheme.SetBrushColour( Brush, clrTimeBack );
memDC.SetBrush(Brush);
memDC.SetBrush(*wxLIGHT_GREY_BRUSH);
//memDC.SetBrush(*wxLIGHT_GREY_BRUSH);
for(i=0; i<mDigits.GetCount(); i++)
memDC.DrawRectangle(mDigits[i].digitBox);
memDC.SetBrush( wxNullBrush );