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

Remove Separator items from menu descriptions; use Section(...)

This commit is contained in:
Paul Licameli
2020-01-29 16:43:53 -05:00
parent c7fac7ae09
commit a84da3dee1
14 changed files with 237 additions and 170 deletions

View File

@@ -633,13 +633,6 @@ namespace MenuTable {
Condition condition;
};
// Describes a separator between menu items
struct SeparatorItem final : SingleItem
{
SeparatorItem() : SingleItem{ wxEmptyString } {}
~SeparatorItem() override;
};
// usage:
// auto scope = FinderScope( findCommandHandler );
// return Items( ... );
@@ -772,6 +765,17 @@ namespace MenuTable {
{ return std::make_unique< MenuItems >(
internalName, std::forward<Args>(args)... ); }
// Like Items, but insert a menu separator between the menu section and
// any other items or sections before or after it in the same (innermost,
// enclosing) menu.
// It's not necessary that the sisters of sections be other sections, but it
// might clarify the logical groupings.
template< typename... Args >
inline std::unique_ptr< MenuSection > Section(
const wxString &internalName, Args&&... args )
{ return std::make_unique< MenuSection >(
internalName, std::forward<Args>(args)... ); }
// Menu items can be constructed two ways, as for group items
// Items will appear in a main toolbar menu or in a sub-menu.
// The name is untranslated. Try to keep the name stable across Audacity
@@ -830,9 +834,6 @@ namespace MenuTable {
return std::make_unique<MenuItem>(
internalName, title, std::move( items ) ); }
inline std::unique_ptr<SeparatorItem> Separator()
{ return std::make_unique<SeparatorItem>(); }
template< typename Handler >
inline std::unique_ptr<CommandItem> Command(
const CommandID &name,