1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

Lose hyphen on selection toolbar

This commit is contained in:
James Crook 2017-06-01 15:03:47 +01:00
parent c48310c519
commit c43a6408d9
2 changed files with 10 additions and 3 deletions

View File

@ -152,10 +152,10 @@ SelectionBar::SelectionBar()
mButtonTitles[0]=NULL;
mButtonTitles[1]=NULL;
mButtonTitles[2]=NULL;
#endif
mHyphen[0]=NULL;
mHyphen[1]=NULL;
mHyphen[2]=NULL;
#endif
// Selection mode of 0 means showing 'start' and 'end' only.
mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
@ -451,11 +451,17 @@ void SelectionBar::Populate()
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
mStartTime = AddTime(_("Start"), StartTimeID, hSizer.get() );
#ifdef SEL_BUTTON_TITLES
mHyphen[0] = AddTitle( "-", -1, hSizer.get() );
#endif
mLengthTime = AddTime(_("Length"), LengthTimeID, hSizer.get() );
#ifdef SEL_BUTTON_TITLES
mHyphen[1] = AddTitle( "-", -1, hSizer.get() );
#endif
mCenterTime = AddTime(_("Center"), CenterTimeID, hSizer.get() );
#ifdef SEL_BUTTON_TITLES
mHyphen[2] = AddTitle( "-", -1, hSizer.get() );
#endif
mEndTime = AddTime(_("End"), EndTimeID, hSizer.get() );
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
@ -859,11 +865,12 @@ void SelectionBar::SetSelectionMode(int mode)
EndTimeID, LengthTimeID, EndTimeID, EndTimeID};
SetDrivers( Drive1[mode], Drive2[mode] );
#ifdef SEL_BUTTON_TITLES
// Show just the hyphen after the first of the items.
for(int i=0;i<3;i++){
mHyphen[i]->SetLabel( ((i+StartTimeID) == Drive2[mode]) ? "- " : "" );
}
#endif
// Then show/hide the relevant controls.
ShowHideControls( mode );
}

View File

@ -166,12 +166,12 @@ class SelectionBar final : public ToolBar {
#ifdef SEL_BUTTON_TITLES
wxStaticText * mButtonTitles[3];
wxStaticText * mHyphen[3];
#endif
wxStaticText * mProxy;
wxStaticText * mHyphen[3];
wxComboBox *mRateBox;
wxChoice *mSnapTo;