Make Audacity source more like DarkAudacity source.

This commit is contained in:
James Crook 2016-09-11 13:03:37 +01:00
parent 70f7ccb58b
commit 545d741eb2
16 changed files with 69 additions and 45 deletions

View File

@ -22,6 +22,7 @@ It is also a place to document colour usage policy in Audacity
#include <wx/colour.h>
#include <wx/dc.h>
#include <wx/dcmemory.h>
#include <wx/settings.h>
#include <wx/utils.h>
@ -227,6 +228,19 @@ void AColor::Bevel(wxDC & dc, bool up, const wxRect & r)
AColor::Line(dc, r.x, r.y + r.height, r.x + r.width, r.y + r.height);
}
void AColor::Bevel2(wxDC & dc, bool up, const wxRect & r)
{
wxBitmap & Bmp = theTheme.Bitmap( up ? bmpUpButtonLarge : bmpDownButtonLarge );
wxMemoryDC memDC;
memDC.SelectObject(Bmp);
int h = wxMin( r.height, Bmp.GetHeight() );
dc.Blit( r.x,r.y,r.width/2, h, &memDC, 0, 0 );
dc.Blit( r.x+r.width/2,r.y,r.width/2, h, &memDC,
Bmp.GetWidth() - r.width/2, 0 );
}
wxColour AColor::Blend( const wxColour & c1, const wxColour & c2 )
{
wxColour c3(

View File

@ -66,6 +66,7 @@ class AColor {
static void Line(wxDC & dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
static void DrawFocus(wxDC & dc, wxRect & r);
static void Bevel(wxDC & dc, bool up, const wxRect & r);
static void Bevel2(wxDC & dc, bool up, const wxRect & r);
static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r);
static wxColour Blend(const wxColour & c1, const wxColour & c2);

View File

@ -269,19 +269,19 @@ void AboutDialog::PopulateAudacityPage( ShuttleGui & S )
CreateCreditsList();
wxString par1Str = _(
"Audacity is a free program written by a worldwide team of <a href=\"http://audacityteam.org/about/credits\">volunteers</a>. \
Audacity is <a href=\"http://audacityteam.org/download\">available</a> for Windows, Mac, and GNU/Linux (and other Unix-like systems).");
"Audacity is a free program written by a worldwide team of [[http://audacityteam.org/about/credits|volunteers]]. \
Audacity is [[http://audacityteam.org/download|available]] available for Windows, Mac, and GNU/Linux (and other Unix-like systems).");
// This trick here means that the English language version won't mention using
// English, whereas all translated versions will.
wxString par2StrUntranslated = wxT(
"If you find a bug or have a suggestion for us, please write, in English, to our <a href=\"mailto:feedback@audacityteam.org\">feedback address</a>. \
For help, view the tips and tricks on our <a href=\"http://wiki.audacityteam.org/\">wiki</a> or \
visit our <a href=\"http://forum.audacityteam.org/\">forum</a>.");
"If you find a bug or have a suggestion for us, please write, in English, to our [[mailto:feedback@audacityteam.org|feedback address]]. \
For help, view the tips and tricks on our [[http://wiki.audacityteam.org/|wiki]] or \
visit our [[http://forum.audacityteam.org/|forum]].");
wxString par2Str = _(
"If you find a bug or have a suggestion for us, please write, in English, to our <a href=\"mailto:feedback@audacityteam.org\">feedback address</a>. \
For help, view the tips and tricks on our <a href=\"http://wiki.audacityteam.org/\">wiki</a> or \
visit our <a href=\"http://forum.audacityteam.org/\">forum</a>.");
"If you find a bug or have a suggestion for us, please write, in English, to our [[mailto:feedback@audacityteam.org|feedback address]]. \
For help, view the tips and tricks on our [[http://wiki.audacityteam.org/|wiki]] or \
visit our [[http://forum.audacityteam.org/|forum]].");
if( par2Str == par2StrUntranslated )
par2Str.Replace( wxT(", in English,"), wxT("") );
@ -302,35 +302,36 @@ visit our <a href=\"http://forum.audacityteam.org/\">forum</a>.");
wxString( wxT("<center>")) +
wxT("<h3>Audacity ") + wxString(AUDACITY_VERSION_STRING) + wxT("</center></h3>") +
_("Free, open source, cross-platform software for recording and editing sounds.") +
wxT(" <a href=\"http://audacityteam.org/\">http://audacityteam.org/</a>") +
wxT(" [[http://audacityteam.org/|http://audacityteam.org/]]") +
wxT("<p><br>") + par1Str +
wxT("<p>") + par2Str +
wxT("<h3>") + _("Credits") + wxT("</h3>") + wxT("<p>") +
wxT("<p><b>") + wxString::Format(_("Team Members")) + wxT("</b><br><br>") +
wxT("<p><b>") + wxString::Format(_("Audacity Team Members")) + wxT("</b><br><br>") +
GetCreditsByRole(roleTeamMember) +
wxT("<p><b> ") + _("Emeritus:") + wxT("</b><br>") +
_("Distinguished Audacity Team members, not currently active") + wxT("<br><br>") +
GetCreditsByRole(roleEmeritusTeam) +
wxT("<p><b>") + _("Contributors") + wxT("</b><br><br>") +
wxT("<p><b>") + _("Contributors") + wxT("</b><br>") +
GetCreditsByRole(roleContributor) +
wxT("<p><b>") + _("Translators") + wxT("</b><br>") +
translatorCredits + wxT("<br>") +
translatorCredits +
GetCreditsByRole(roleTranslators) +
wxT("<p><b>") + _("Libraries") + wxT("</b><br>") +
wxT("Audacity includes code from the following projects:") + wxT("<br><br>") +
GetCreditsByRole(roleLibrary) +
wxT("<p><b>") + _("Special thanks:") + wxT("</b><br><br>") +
wxT("<p><b>") + _("Special thanks:") + wxT("</b><br>") +
GetCreditsByRole(roleThanks) +
wxT("<p><br>") + _("<b>Audacity&reg;</b> software is copyright")+
wxT("<p><br>") + _("<b>Audacity<sup>&reg;</sup></b> software is copyright")+
wxT("&copy; 1999-2016 Audacity Team.<br>") +
_("The name <b>Audacity&reg;</b> is a registered trademark of Dominic Mazzoni.") +
_("The name <b>Audacity<sup>&reg;</sup></b> is a registered trademark of Dominic Mazzoni.") +
wxT("<p><br>")+_("Audacity website: [[http://www.audacityteam.org/|http://www.audacityteam.org/]]") +
wxT("</center>"));
@ -579,7 +580,7 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S )
// Uncomment the next two lines to test hyperlinks work from here.
// AddBuildinfoRow(&informationStr, wxT("Link Test:"),
// wxT("<a href=\"https:web.audacityteam.org\">Click bait</a>") );
// wxT("[[https:www.audacityteam.org|Click bait]]") );
AddBuildinfoRow(&informationStr, _("Commit Id:"),
#include "RevisionIdent.h"

View File

@ -169,6 +169,8 @@ void QuitAudacity();
// Marks strings for extraction only...must use wxGetTranslation() to translate.
#define XO(s) wxT(s)
// Marks string for substitution only.
#define _TS(s) wxT(s)
// This renames a good use of this C++ keyword that we don't need to review when hunting for leaks.
#define PROHIBITED = delete

View File

@ -1069,7 +1069,7 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
rpt.AddAll(ctx);
wxFileName fn(FileNames::DataDir(), wxT("audacity.cfg"));
rpt.AddFile(fn.GetFullPath(), wxT("Audacity Configuration"));
rpt.AddFile(fn.GetFullPath(), _TS("Audacity Configuration"));
rpt.AddFile(FileNames::PluginRegistry(), wxT("Plugin Registry"));
rpt.AddFile(FileNames::PluginSettings(), wxT("Plugin Settings"));
@ -1081,7 +1081,7 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
AudacityLogger *logger = GetLogger();
if (logger)
{
rpt.AddText(wxT("log.txt"), logger->GetLog(), wxT("Audacity Log"));
rpt.AddText(wxT("log.txt"), logger->GetLog(), _TS("Audacity Log"));
}
bool ok = wxDebugReportPreviewStd().Show(rpt);
@ -1197,8 +1197,8 @@ bool AudacityApp::OnInit()
wxTheApp->SetAppName(appName);
// Explicitly set since OSX will use it for the "Quit" menu item
wxTheApp->SetAppDisplayName(wxT("Audacity"));
wxTheApp->SetVendorName(wxT("Audacity"));
wxTheApp->SetAppDisplayName(appName);
wxTheApp->SetVendorName(appName);
// Unused strings that we want to be translated, even though
// we're not using them yet...

View File

@ -79,7 +79,7 @@ void AudacityLogger::DoLogText(const wxString & str)
TimeStamp(&stamp);
mBuffer << stamp << wxT("Audacity ") << AUDACITY_VERSION_STRING << wxT("\n");
mBuffer << stamp << _TS("Audacity ") << AUDACITY_VERSION_STRING << wxT("\n");
}
mBuffer << str << wxT("\n");

View File

@ -208,7 +208,7 @@ static wxString HelpTextBuiltIn( const wxString & Key )
wxString(wxT("<p>"))+
_("Audacity can import unprotected files in many other formats (such as M4A and WMA, \
compressed WAV files from portable recorders and audio from video files) if you download and install \
the optional [[http://manual.audacityteam.org/man/faq_opening_and_saving_files.html#foreign| \
the optional [[http://manual.audacityteam.org/man/faq_opening_and_saving_files.html#foreign|\
FFmpeg library]] to your computer.") + wxT("</p><p>") +
_("You can also read our help on importing \
[[http://manual.audacityteam.org/man/faq_opening_and_saving_files.html#midi|MIDI files]] \
@ -263,4 +263,4 @@ wxString FormatHtmlText( const wxString & Text ){
wxT("\"></head>") +
WrapText( LinkExpand( Text ))+
wxT("</html>");
}
}

View File

@ -871,7 +871,7 @@ END_EVENT_TABLE()
AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
const wxPoint & pos,
const wxSize & size)
: wxFrame(parent, id, wxT("Audacity"), pos, size),
: wxFrame(parent, id, _TS("Audacity"), pos, size),
mRate((double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), AudioIO::GetOptimalSupportedSampleRate())),
mDefaultFormat((sampleFormat) gPrefs->
Read(wxT("/SamplingRate/DefaultProjectSampleFormat"), floatSample)),
@ -1380,14 +1380,14 @@ void AudacityProject::SetProjectTitle( int number)
// is none.
if( number >= 0 ){
/* i18n-hint: The %02i is the project number, the %s is the project name.*/
name = wxString::Format( wxT("[Project %02i] Audacity \"%s\""), number+1 ,
name = wxString::Format( _TS("[Project %02i] Audacity \"%s\""), number+1 ,
name.IsEmpty() ? "<untitled>" : name.c_str() );
}
// If we are not showing numbers, then <untitled> shows as 'Audacity'.
else if( name.IsEmpty() )
{
mbLoadedFromAup = false;
name = wxT("Audacity");
name = _TS("Audacity");
}
if (mIsRecovered)

View File

@ -434,6 +434,17 @@ void FlowPacker::SetNewGroup( int iGroupSize )
mComponentWidth=0;
}
void FlowPacker::SetColourGroup( )
{
myPosBase = 750;
mxPos =0;
mOldFlags = mFlags;
iImageGroupSize = 1;
iImageGroupIndex = -1;
mComponentWidth=0;
myHeight = 11;
}
void FlowPacker::GetNextPosition( int xSize, int ySize )
{
// if the height has increased, then we are on a NEW group.
@ -504,7 +515,7 @@ int SourceOutputStream::OpenFile(const wxString & Filename)
File.Write( wxT("//\r\n") );
File.Write( wxT("// This file was Auto-Generated.\r\n") );
File.Write( wxT("// It is included by Theme.cpp.\r\n") );
File.Write( wxT("// Only check this into SVN if you've read and understood the guidelines!\r\n\r\n ") );
File.Write( wxT("// Only check this into Git if you've read and understood the guidelines!\r\n\r\n ") );
}
return bOk;
}
@ -588,9 +599,8 @@ void ThemeBase::CreateImageCache( bool bBinarySave )
// Now save the colours.
int x,y;
mFlow.SetNewGroup(1);
const int iColSize=10;
mFlow.myHeight = iColSize+1;
mFlow.SetColourGroup();
const int iColSize = 10;
for(i=0;i<(int)mColours.GetCount();i++)
{
mFlow.GetNextPosition( iColSize, iColSize );
@ -711,8 +721,8 @@ void ThemeBase::WriteImageMap( )
}
}
// Now save the colours.
mFlow.SetNewGroup(1);
const int iColSize=10;
mFlow.SetColourGroup();
const int iColSize = 10;
for(i=0;i<(int)mColours.GetCount();i++)
{
mFlow.GetNextPosition( iColSize, iColSize );
@ -849,10 +859,9 @@ bool ThemeBase::ReadImageCache( bool bBinaryRead, bool bOkIfNotFound)
// return true; //To not load colours..
// Now load the colours.
int x,y;
mFlow.SetNewGroup(1);
mFlow.SetColourGroup();
wxColour TempColour;
const int iColSize=10;
mFlow.myHeight = iColSize+1;
for(i=0;i<(int)mColours.GetCount();i++)
{
mFlow.GetNextPosition( iColSize, iColSize );

View File

@ -60,6 +60,7 @@ public:
void Init(int width);
void GetNextPosition( int xSize, int ySize );
void SetNewGroup( int iGroupSize );
void SetColourGroup( );
wxRect Rect();
void RectMid( int &x, int &y );

View File

@ -2,7 +2,7 @@
//
// This file was Auto-Generated.
// It is included by Theme.cpp.
// Only check this into SVN if you've read and understood the guidelines!
// Only check this into Git if you've read and understood the guidelines!
137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,1,184,
0,0,3,68,8,6,0,0,0,194,5,58,248,0,0,0,4,115,66,73,

View File

@ -174,7 +174,6 @@ public:
wxFileName GetAutoExportFileName();
private:
wxString mFormatName;
bool ExamineTracks();
bool GetFilename();
bool CheckFilename();
@ -186,6 +185,7 @@ private:
void OnFilterChanged(wxFileCtrlEvent & evt);
private:
wxString mFormatName;
FileDialog *mDialog;
wxString mFileDialogTitle;
AudacityProject *mProject;

View File

@ -264,7 +264,7 @@ void
GetGStreamerImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
{
wxLogMessage(wxT("Audacity is built against GStreamer version %d.%d.%d-%d"),
wxLogMessage(_TS("Audacity is built against GStreamer version %d.%d.%d-%d"),
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
GST_VERSION_MICRO,

View File

@ -197,7 +197,6 @@ void TracksPrefs::SetPinnedHeadPreference(bool value, bool flush)
gPrefs->Flush();
}
bool TracksPrefs::Apply()
{
ShuttleGui S(this, eIsSavingToPrefs);

View File

@ -1615,11 +1615,6 @@ void ASlider::OnPaint(wxPaintEvent & WXUNUSED(event))
{
wxPaintDC dc(this);
#ifdef EXPERIMENTAL_THEMING
wxColour Col(GetParent()->GetBackgroundColour());
this->SetBackgroundColour( Col );
#endif
mLWSlider->OnPaint(dc);
if ( mSliderIsFocused )

View File

@ -316,11 +316,13 @@ Meter::Meter(AudacityProject *project,
{
if(mIsInput)
{
mIcon = std::make_unique<wxBitmap>(MicMenuNarrow_xpm);
//mIcon = new wxBitmap(MicMenuNarrow_xpm);
mIcon = std::make_unique<wxBitmap>(wxBitmap(theTheme.Bitmap(bmpMic)));
}
else
{
mIcon = std::make_unique<wxBitmap>(SpeakerMenuNarrow_xpm);
//mIcon = new wxBitmap(SpeakerMenuNarrow_xpm);
mIcon = std::make_unique<wxBitmap>(wxBitmap(theTheme.Bitmap(bmpSpeaker)));
}
}