1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-09 06:06:24 +01:00

Bug 1701 - Mac: Text descriptors in Selection Toolbar become invisible after Open command

Problem was that on mac enable/disable clears the colour back to black.
The easiest workaround was to create a new class auStaticText that does all that we
need for wxStaticText.
This commit is contained in:
James Crook
2017-08-12 21:49:38 +01:00
parent f2ee945da0
commit dc05b94fd1
8 changed files with 71 additions and 27 deletions

View File

@@ -208,8 +208,9 @@ wxRadioButton * SelectionBar::AddRadioButton( const wxString & Name,
return pBtn;
}
wxStaticText * SelectionBar::AddTitle( const wxString & Title, int id, wxSizer * pSizer ){
wxStaticText * pTitle = safenew wxStaticText(this, id,Title );
auStaticText * SelectionBar::AddTitle( const wxString & Title, wxSizer * pSizer ){
auStaticText * pTitle = safenew auStaticText(this, Title );
pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.Length() == 1 ) ? 0:5);
return pTitle;
@@ -222,7 +223,6 @@ NumericTextCtrl * SelectionBar::AddTime( const wxString Name, int id, wxSizer *
NumericTextCtrl * pCtrl = safenew NumericTextCtrl(
NumericConverter::TIME, this, id, formatName, 0.0, mRate);
pCtrl->SetName(Name);
pCtrl->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
pCtrl->EnableMenu();
pSizer->Add(pCtrl, 0, wxALIGN_TOP | wxRIGHT, 5);
return pCtrl;
@@ -238,6 +238,7 @@ void SelectionBar::AddVLine( wxSizer * pSizer ){
void SelectionBar::Populate()
{
SetBackgroundColour( theTheme.Colour( clrMedium ) );
mStartTime = mEndTime = mLengthTime = mCenterTime = mAudioTime = nullptr;
#ifdef SEL_RADIO_TITLE
mStartEndProxy = mStartLengthProxy = mLengthEndProxy = mLengthCenterProxy = nullptr;
@@ -273,26 +274,15 @@ void SelectionBar::Populate()
wxColour clrText = theTheme.Colour( clrTrackPanelText );
wxColour clrText2 = *wxBLUE;
wxStaticText * pProjRate = safenew wxStaticText(this, -1, _("Project Rate (Hz):"),
// LLL: On my Ubuntu 7.04 install, the label wraps to two lines
// and I could not figure out why. Thus...hackage.
#if defined(__WXGTK__)
wxDefaultPosition, wxSize(110, -1));
#else
wxDefaultPosition, wxDefaultSize);
#endif
pProjRate->SetForegroundColour( clrText );
mainSizer->Add(pProjRate,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
AddTitle( _("Project Rate (Hz):"), mainSizer );
AddVLine( mainSizer );
AddTitle( _("Snap-To"), -1, mainSizer );
AddTitle( _("Snap-To"), mainSizer );
#ifdef OPTIONS_BUTTON
// Not enough room to say 'Selection Options". There is a tooltip instead.
AddTitle( wxT(""), -1, mainSizer );
AddTitle( wxT(""), mainSizer );
#endif
AddVLine( mainSizer );
AddTitle( _("Audio Position"), -1, mainSizer );
AddTitle( _("Audio Position"), mainSizer );
AddVLine( mainSizer );
{

View File

@@ -83,7 +83,7 @@ class SelectionBar final : public ToolBar {
private:
wxRadioButton * AddRadioButton( const wxString & Name, int id,
wxSizer * pSizer, long style);
wxStaticText * AddTitle( const wxString & Title, int id,
auStaticText * AddTitle( const wxString & Title,
wxSizer * pSizer );
NumericTextCtrl * AddTime( const wxString Name, int id, wxSizer * pSizer );
void AddVLine( wxSizer * pSizer );