1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-02 14:17:07 +01:00

Cleaner code to pop non toggle buttons up.

This commit is contained in:
James Crook
2017-04-09 19:07:28 +01:00
parent ffdba2eb2b
commit 6e440056f9
2 changed files with 5 additions and 9 deletions

View File

@@ -246,15 +246,8 @@ void EditToolBar::OnButton(wxCommandEvent &event)
// due to bugs elsewhere (see: AudacityProject::UpdateMenus() )
// Be sure the pop-up happens even if there are exceptions
// Except, Sync Lock button is a toggle...
auto cleanup = finally( [&] {
bool bIsToggle = false;
#ifdef OPTION_SYNC_LOCK_BUTTON
bIsToggle = bIsToggle || ( id == ETBSyncLockID );
#endif
if( !bIsToggle )
SetButton(false, mButtons[id]);
}
// except for buttons which toggle.
auto cleanup = finally( [&] { mButtons[id]->InteractionOver();}
);
switch (id) {