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:
parent
326392e58c
commit
70967bfebd
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue