From 1d1dded9bad3cd25e0cf11480c37fd0a360e371c Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 12 Jun 2017 15:02:28 -0400 Subject: [PATCH] TrackInfo::SetTrackInfoFont is static --- src/TrackPanel.cpp | 12 +++++++----- src/TrackPanel.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index fbd6af18e..2a353c0ac 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -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); } diff --git a/src/TrackPanel.h b/src/TrackPanel.h index afddf8624..ffdaae8db 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -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 mGainCaptured, mPanCaptured, mGain, mPan; #ifdef EXPERIMENTAL_MIDI_OUT