1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 09:00:07 +02:00

TrackInfo::SetTrackInfoFont is static

This commit is contained in:
Paul Licameli 2017-06-12 15:02:28 -04:00
parent a4e57fc45e
commit 1d1dded9ba
2 changed files with 9 additions and 7 deletions

View File

@ -9007,10 +9007,12 @@ void TrackInfo::GetMidiControlsRect(const wxRect & rect, wxRect & dest)
}
#endif
wxFont TrackInfo::gFont;
/// \todo Probably should move to 'Utils.cpp'.
void TrackInfo::SetTrackInfoFont(wxDC * dc) const
void TrackInfo::SetTrackInfoFont(wxDC * dc)
{
dc->SetFont(mFont);
dc->SetFont(gFont);
}
void TrackInfo::DrawBordersWithin
@ -9375,18 +9377,18 @@ void TrackInfo::UpdatePrefs()
// the language preference changed.
int fontSize = 10;
mFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
gFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
int allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
int textWidth, textHeight;
do {
mFont.SetPointSize(fontSize);
gFont.SetPointSize(fontSize);
pParent->GetTextExtent(_("Stereo, 999999Hz"),
&textWidth,
&textHeight,
NULL,
NULL,
&mFont);
&gFont);
fontSize--;
} while (textWidth >= allowableWidth);
}

View File

@ -85,7 +85,7 @@ public:
private:
int GetTrackInfoWidth() const;
void SetTrackInfoFont(wxDC *dc) const;
static void SetTrackInfoFont(wxDC *dc);
void DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const;
@ -135,7 +135,7 @@ private:
void UpdatePrefs();
TrackPanel * pParent;
wxFont mFont;
static wxFont gFont;
std::unique_ptr<LWSlider>
mGainCaptured, mPanCaptured, mGain, mPan;
#ifdef EXPERIMENTAL_MIDI_OUT