1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-14 23:40:12 +02:00

Conditional compilation flag can disabled the checkmarks in scrub sub menu

This commit is contained in:
Paul Licameli 2016-04-27 20:35:32 -04:00
parent 926dfb7253
commit cc9b880852

View File

@ -25,6 +25,9 @@ Paul Licameli split from TrackPanel.cpp
#include <wx/dc.h> #include <wx/dc.h>
// Conditional compilation switch for making scrub menu items checkable
#define CHECKABLE_SCRUB_MENU_ITEMS
enum { enum {
// PRL: // PRL:
// Mouse must move at least this far to distinguish ctrl-drag to scrub // Mouse must move at least this far to distinguish ctrl-drag to scrub
@ -742,9 +745,15 @@ void Scrubber::AddMenuItems()
cm->BeginSubMenu(_("Scru&bbing")); cm->BeginSubMenu(_("Scru&bbing"));
for (const auto &item : menuItems) { for (const auto &item : menuItems) {
#ifdef CHECKABLE_SCRUB_MENU_ITEMS
cm->AddCheck(item.name, wxGetTranslation(item.label), cm->AddCheck(item.name, wxGetTranslation(item.label),
FNT(Scrubber, this, item.memFn), FNT(Scrubber, this, item.memFn),
false, flags, mask); false, flags, mask);
#else
cm->AddItem(item.name, wxGetTranslation(item.label),
FNT(Scrubber, this, item.memFn),
flags, mask);
#endif
} }
cm->EndSubMenu(); cm->EndSubMenu();
CheckMenuItem(); CheckMenuItem();
@ -763,18 +772,22 @@ void Scrubber::PopulateMenu(wxMenu &menu)
void Scrubber::UncheckAllMenuItems() void Scrubber::UncheckAllMenuItems()
{ {
#ifdef CHECKABLE_SCRUB_MENU_ITEMS
auto cm = mProject->GetCommandManager(); auto cm = mProject->GetCommandManager();
for (const auto &item : menuItems) for (const auto &item : menuItems)
cm->Check(item.name, false); cm->Check(item.name, false);
#endif
} }
void Scrubber::CheckMenuItem() void Scrubber::CheckMenuItem()
{ {
#ifdef CHECKABLE_SCRUB_MENU_ITEMS
if(HasStartedScrubbing()) { if(HasStartedScrubbing()) {
auto cm = mProject->GetCommandManager(); auto cm = mProject->GetCommandManager();
auto item = FindMenuItem(mSmoothScrollingScrub, mAlwaysSeeking); auto item = FindMenuItem(mSmoothScrollingScrub, mAlwaysSeeking);
cm->Check(item.name, true); cm->Check(item.name, true);
} }
#endif
} }
#endif #endif