Hierarchical menu parents don't get ...'s.

Also moves the Convert menu up a level.  Nested hierarchical menus
should be avoided whenever possible.
This commit is contained in:
Jeff Young 2021-01-06 16:39:28 +00:00
parent 326392e58c
commit 70967bfebd
2 changed files with 4 additions and 7 deletions

View File

@ -69,7 +69,7 @@ bool CONVERT_TOOL::Init()
// Create a context menu and make it available through selection tool // Create a context menu and make it available through selection tool
m_menu = new CONDITIONAL_MENU( this ); m_menu = new CONDITIONAL_MENU( this );
m_menu->SetIcon( convert_xpm ); m_menu->SetIcon( convert_xpm );
m_menu->SetTitle( _( "Convert..." ) ); m_menu->SetTitle( _( "Convert" ) );
static KICAD_T convertableTracks[] = { PCB_TRACE_T, PCB_ARC_T, EOT }; static KICAD_T convertableTracks[] = { PCB_TRACE_T, PCB_ARC_T, EOT };
static KICAD_T convertableZones[] = { PCB_ZONE_T, PCB_FP_ZONE_T, EOT }; static KICAD_T convertableZones[] = { PCB_ZONE_T, PCB_FP_ZONE_T, EOT };
@ -106,11 +106,8 @@ bool CONVERT_TOOL::Init()
m_menu->AddItem( PCB_ACTIONS::convertToArc, lineToArc ); m_menu->AddItem( PCB_ACTIONS::convertToArc, lineToArc );
for( std::shared_ptr<ACTION_MENU>& subMenu : m_selectionTool->GetToolMenu().GetSubMenus() ) CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
{ selToolMenu.AddMenu( m_menu, showConvert, 100 );
if( dynamic_cast<SPECIAL_TOOLS_CONTEXT_MENU*>( subMenu.get() ) )
static_cast<CONDITIONAL_MENU*>( subMenu.get() )->AddMenu( m_menu, showConvert );
}
return true; return true;
} }

View File

@ -87,7 +87,7 @@ SPECIAL_TOOLS_CONTEXT_MENU::SPECIAL_TOOLS_CONTEXT_MENU( TOOL_INTERACTIVE* aTool
CONDITIONAL_MENU( aTool ) CONDITIONAL_MENU( aTool )
{ {
SetIcon( special_tools_xpm ); SetIcon( special_tools_xpm );
SetTitle( _( "Special Tools..." ) ); SetTitle( _( "Special Tools" ) );
AddItem( PCB_ACTIONS::moveExact, SELECTION_CONDITIONS::ShowAlways ); AddItem( PCB_ACTIONS::moveExact, SELECTION_CONDITIONS::ShowAlways );
AddItem( PCB_ACTIONS::moveWithReference, SELECTION_CONDITIONS::ShowAlways ); AddItem( PCB_ACTIONS::moveWithReference, SELECTION_CONDITIONS::ShowAlways );