1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-23 15:41:09 +02:00

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

View File

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

View File

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

View File

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