1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-10 16:35:32 +01:00

Restore separators after "Move Track to Bottom" in TCP menus

This commit is contained in:
Paul Licameli
2020-02-06 16:51:54 -05:00
parent 3d5b0d4dd0
commit 540f2c5e67
4 changed files with 22 additions and 12 deletions

View File

@@ -123,6 +123,7 @@ void Visitor::Visit(SingleItem &, const Path &) {}
void MenuVisitor::BeginGroup( Registry::GroupItem &item, const Path &path )
{
bool isMenu = false;
bool isExtension = false;
auto pItem = &item;
if ( pItem->Transparent() ) {
}
@@ -130,8 +131,9 @@ void MenuVisitor::BeginGroup( Registry::GroupItem &item, const Path &path )
if ( !needSeparator.empty() )
needSeparator.back() = true;
}
else {
else if ( auto pWhole = dynamic_cast<MenuTable::WholeMenu*>( pItem ) ) {
isMenu = true;
isExtension = pWhole->extension;
MaybeDoSeparator();
}
@@ -139,7 +141,7 @@ void MenuVisitor::BeginGroup( Registry::GroupItem &item, const Path &path )
if ( isMenu ) {
needSeparator.push_back( false );
firstItem.push_back( true );
firstItem.push_back( !isExtension );
}
}
@@ -152,7 +154,7 @@ void MenuVisitor::EndGroup( Registry::GroupItem &item, const Path &path )
if ( !needSeparator.empty() )
needSeparator.back() = true;
}
else {
else if ( dynamic_cast<MenuTable::WholeMenu*>( pItem ) ) {
firstItem.pop_back();
needSeparator.pop_back();
}
@@ -241,6 +243,7 @@ CommandGroupItem::~CommandGroupItem() {}
SpecialItem::~SpecialItem() {}
MenuSection::~MenuSection() {}
WholeMenu::~WholeMenu() {}
CommandHandlerFinder FinderScope::sFinder =
[](AudacityProject &project) -> CommandHandlerObject & {