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

Bug2184: should not grey Effect menu when selection is point

This commit is contained in:
Paul Licameli
2019-08-03 11:58:18 -04:00
parent 664452b1a8
commit 51f2578e0a
4 changed files with 21 additions and 15 deletions

View File

@@ -101,12 +101,17 @@ public:
// then the enabler will be invoked (unless the menu item is constructed with
// the useStrictFlags option, or the applicability test first returns false).
// The item's full set of required flags is passed to the function.
// Computation of the flags is delayed inside a function -- because often you
// need to name a statically allocated CommandFlag, or a bitwise OR of some,
// while they may not have been initialized yet, during static initialization.
struct MenuItemEnabler {
using Flags = std::function< CommandFlag() >;
using Test = std::function< bool( const AudacityProject& ) >;
using Action = std::function< void( AudacityProject&, CommandFlag ) >;
const CommandFlag &actualFlags;
const CommandFlag &possibleFlags;
const Flags actualFlags;
const Flags possibleFlags;
Test applicable;
Action tryEnable;
};