Rad dude! Being the squeaky wheel... Ignore the e-mail--it is the same as this.steve wrote:You can attach patch files that have the file extension .patchEdgar wrote:Let me send you a patch via e-mail since we may not attach .patch files here.
(we added that a while back, I think in response to your previous complaint)
Code: Select all
Index: src/prefs/GUIPrefs.cpp
===================================================================
--- src/prefs/GUIPrefs.cpp (revision 11430)
+++ src/prefs/GUIPrefs.cpp (working copy)
@@ -20,6 +20,7 @@
#include "../Audacity.h"
#include <wx/defs.h>
+#include <wx/fontdlg.h>
#include "../AudacityApp.h"
#include "../Languages.h"
@@ -28,6 +29,12 @@
#include "GUIPrefs.h"
+#define ID_FONTDIALOG_BUTTON 7777
+
+BEGIN_EVENT_TABLE(GUIPrefs, PrefsPanel)
+ EVT_BUTTON(ID_FONTDIALOG_BUTTON, GUIPrefs::OnFontDialogButton)
+END_EVENT_TABLE()
+
GUIPrefs::GUIPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Interface"))
{
@@ -78,6 +85,17 @@
// ----------------------- End of main section --------------
}
+void GUIPrefs::OnFontDialogButton(wxCommandEvent & e)
+{
+ wxFontDialog fontDialog = new wxFontDialog((wxWindow *)this);
+ fontDialog.ShowModal();
+ wxFontData fontData = fontDialog.GetFontData();
+ gPrefs->Write(wxT("/GUI/NativeFontForNameInWaveform"), fontData.GetChosenFont().GetNativeFontInfoDesc());
+ const wxColor fontColor = fontData.GetColour();
+ wxString fontColorAsString = fontColor.GetAsString(wxC2S_HTML_SYNTAX);
+ gPrefs->Write(wxT("/GUI/FontColorForNameInWaveform"), fontColorAsString);
+}
+
void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(2);
@@ -128,6 +146,8 @@
S.TieCheckBox(_("&Show track name in waveform display"),
wxT("/GUI/ShowTrackNameInWaveform"),
false);
+ S.Id(ID_FONTDIALOG_BUTTON).AddButton(_("System Font Dialog for waveform text..."),
+ wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
}
S.EndStatic();
Index: src/prefs/GUIPrefs.h
===================================================================
--- src/prefs/GUIPrefs.h (revision 11430)
+++ src/prefs/GUIPrefs.h (working copy)
@@ -17,6 +17,8 @@
#include <wx/arrstr.h>
#include <wx/window.h>
+#include <wx/clrpicker.h>
+#include <wx/textctrl.h>
#include "../ShuttleGui.h"
@@ -41,6 +43,10 @@
wxArrayString mRangeCodes;
wxArrayString mRangeChoices;
+
+ void OnFontDialogButton(wxCommandEvent & e);
+
+ DECLARE_EVENT_TABLE();
};
#endif
Index: src/TrackArtist.cpp
===================================================================
--- src/TrackArtist.cpp (revision 11430)
+++ src/TrackArtist.cpp (working copy)
@@ -160,6 +160,7 @@
#include <wx/pen.h>
#include <wx/log.h>
#include <wx/datetime.h>
+//#include <wx/string.h>
#ifdef USE_MIDI
#include "NoteTrack.h"
@@ -321,7 +322,10 @@
dc.DrawRectangle(clip);
#endif
- wxFont labelFont(8, wxSWISS, wxNORMAL, wxNORMAL);
+ wxFont labelFont(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL);
+ wxString fontDescription = gPrefs->Read(wxT("/GUI/NativeFontForNameInWaveform"), wxEmptyString);
+ if (!fontDescription.IsEmpty())
+ labelFont.SetNativeFontInfo(fontDescription);
dc.SetFont(labelFont);
gPrefs->Read(wxT("/GUI/ShowTrackNameInWaveform"), &mbShowTrackNameInWaveform, false);
@@ -403,8 +407,21 @@
case WaveTrack::WaveformDisplay:
DrawWaveform(wt, dc, r, viewInfo,
drawEnvelope, drawSamples, drawSliders, false, muted);
- if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel) // so left or mono only
+
+ if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel) { // so left or mono only
+ const wxColour& originalForegroundTextColor = dc.GetTextForeground();
+ wxString fontColorAsString;
+ if (gPrefs->Read(wxT("/GUI/FontColorForNameInWaveform"), &fontColorAsString)) {
+ wxColour newForegroundColorFromPrefs(fontColorAsString);
+ dc.SetTextForeground(newForegroundColorFromPrefs);
+ }
+ else {
+ wxColour newForegroundColor(0, 0, 0);
+ dc.SetTextForeground(newForegroundColor);
+ }
dc.DrawText (wt->GetName(), r.x+10, r.y); // move right 10 pixels to avoid overwriting <- symbol
+ dc.SetTextForeground(originalForegroundTextColor);
+ }
break;
case WaveTrack::WaveformDBDisplay:
DrawWaveform(wt, dc, r, viewInfo,