mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +02:00
TrackInfo::SetTrackInfoFont is static
This commit is contained in:
parent
a4e57fc45e
commit
1d1dded9ba
@ -9007,10 +9007,12 @@ void TrackInfo::GetMidiControlsRect(const wxRect & rect, wxRect & dest)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxFont TrackInfo::gFont;
|
||||||
|
|
||||||
/// \todo Probably should move to 'Utils.cpp'.
|
/// \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
|
void TrackInfo::DrawBordersWithin
|
||||||
@ -9375,18 +9377,18 @@ void TrackInfo::UpdatePrefs()
|
|||||||
// the language preference changed.
|
// the language preference changed.
|
||||||
|
|
||||||
int fontSize = 10;
|
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 allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
|
||||||
int textWidth, textHeight;
|
int textWidth, textHeight;
|
||||||
do {
|
do {
|
||||||
mFont.SetPointSize(fontSize);
|
gFont.SetPointSize(fontSize);
|
||||||
pParent->GetTextExtent(_("Stereo, 999999Hz"),
|
pParent->GetTextExtent(_("Stereo, 999999Hz"),
|
||||||
&textWidth,
|
&textWidth,
|
||||||
&textHeight,
|
&textHeight,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&mFont);
|
&gFont);
|
||||||
fontSize--;
|
fontSize--;
|
||||||
} while (textWidth >= allowableWidth);
|
} while (textWidth >= allowableWidth);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int GetTrackInfoWidth() const;
|
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;
|
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();
|
void UpdatePrefs();
|
||||||
|
|
||||||
TrackPanel * pParent;
|
TrackPanel * pParent;
|
||||||
wxFont mFont;
|
static wxFont gFont;
|
||||||
std::unique_ptr<LWSlider>
|
std::unique_ptr<LWSlider>
|
||||||
mGainCaptured, mPanCaptured, mGain, mPan;
|
mGainCaptured, mPanCaptured, mGain, mPan;
|
||||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user