mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 08:27:13 +01:00
Command manager stores checkmark predicates...
... and we use them to simplify (the misnamed) MenuManager::ModifyToolbarMenus. It looked wrong that statically constructed menu descriptions should ever hold constant boolean checkmark values, rather than functions to re-eveluate the checkmark state as needed.
This commit is contained in:
@@ -389,8 +389,6 @@ BaseItemSharedPtr ViewMenu()
|
||||
{
|
||||
using Options = CommandManager::Options;
|
||||
|
||||
static const auto checkOff = Options{}.CheckState( false );
|
||||
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
Menu( wxT("View"), XO("&View"),
|
||||
@@ -448,7 +446,10 @@ BaseItemSharedPtr ViewMenu()
|
||||
#if defined(EXPERIMENTAL_EFFECTS_RACK)
|
||||
,
|
||||
Command( wxT("ShowEffectsRack"), XXO("Show Effects Rack"),
|
||||
FN(OnShowEffectsRack), AlwaysEnabledFlag, checkOff )
|
||||
FN(OnShowEffectsRack), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( [](AudacityProject &project){
|
||||
auto &rack = EffectRack::Get( project );
|
||||
return rack.IsShown(); } ) )
|
||||
#endif
|
||||
)
|
||||
) ) };
|
||||
|
||||
Reference in New Issue
Block a user