1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-13 16:15:48 +01:00

Context menu for scrub head shows checkmarks, and is available during scrub

This commit is contained in:
Paul Licameli
2016-04-27 20:56:38 -04:00
parent d1d0ea022f
commit 042d6801df
2 changed files with 28 additions and 15 deletions

View File

@@ -763,9 +763,20 @@ void Scrubber::PopulateMenu(wxMenu &menu)
{
int id = CMD_ID;
auto cm = mProject->GetCommandManager();
const MenuItem *checkedItem =
HasStartedScrubbing()
? &FindMenuItem(mSmoothScrollingScrub, mAlwaysSeeking)
: nullptr;
for (const auto &item : menuItems) {
if (cm->GetEnabled(item.name))
if (cm->GetEnabled(item.name)) {
#ifdef CHECKABLE_SCRUB_MENU_ITEMS
menu.AppendCheckItem(id, item.label);
if(&item == checkedItem)
menu.FindItem(id)->Check();
#else
menu.Append(id, item.label);
#endif
}
++id;
}
}