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

Delay evaluation of checkmark states...

... so that more menu item descriptions can be statically constructed once only
This commit is contained in:
Paul Licameli
2019-01-09 14:14:40 -05:00
parent 512c27d422
commit 93c2bb9322
11 changed files with 57 additions and 24 deletions

View File

@@ -1136,7 +1136,8 @@ MenuTable::BaseItemPtr Scrubber::Menu()
item.flags,
item.StatusTest
? // a checkmark item
Options{}.CheckState( (this->*item.StatusTest)() )
Options{}.CheckTest( [&item](AudacityProject &project){
return ( Scrubber::Get(project).*(item.StatusTest) )(); } )
: // not a checkmark item
Options{}
) );

View File

@@ -118,7 +118,7 @@ public:
bool CanScrub() const;
// For the toolbar
MenuTable::BaseItemPtr Menu();
static MenuTable::BaseItemPtr Menu();
// For popup
void PopulatePopupMenu(wxMenu &menu);