From 70967bfebd0f01aa2567cc7cfbee7e59830cf418 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 6 Jan 2021 16:39:28 +0000 Subject: [PATCH] Hierarchical menu parents don't get ...'s. Also moves the Convert menu up a level. Nested hierarchical menus should be avoided whenever possible. --- pcbnew/tools/convert_tool.cpp | 9 +++------ pcbnew/tools/edit_tool.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index 62e26ee7b4..329bacbd07 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -69,7 +69,7 @@ bool CONVERT_TOOL::Init() // Create a context menu and make it available through selection tool m_menu = new CONDITIONAL_MENU( this ); 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 convertableZones[] = { PCB_ZONE_T, PCB_FP_ZONE_T, EOT }; @@ -106,11 +106,8 @@ bool CONVERT_TOOL::Init() m_menu->AddItem( PCB_ACTIONS::convertToArc, lineToArc ); - for( std::shared_ptr& subMenu : m_selectionTool->GetToolMenu().GetSubMenus() ) - { - if( dynamic_cast( subMenu.get() ) ) - static_cast( subMenu.get() )->AddMenu( m_menu, showConvert ); - } + CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); + selToolMenu.AddMenu( m_menu, showConvert, 100 ); return true; } diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index c1336085c0..5954c5b195 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -87,7 +87,7 @@ SPECIAL_TOOLS_CONTEXT_MENU::SPECIAL_TOOLS_CONTEXT_MENU( TOOL_INTERACTIVE* aTool CONDITIONAL_MENU( aTool ) { SetIcon( special_tools_xpm ); - SetTitle( _( "Special Tools..." ) ); + SetTitle( _( "Special Tools" ) ); AddItem( PCB_ACTIONS::moveExact, SELECTION_CONDITIONS::ShowAlways ); AddItem( PCB_ACTIONS::moveWithReference, SELECTION_CONDITIONS::ShowAlways );