Give diff pair toolbutton a menu also

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8233
This commit is contained in:
Jon Evans 2021-04-22 21:37:15 -04:00
parent d934dae21a
commit 3e96fb851c
1 changed files with 17 additions and 7 deletions

View File

@ -458,14 +458,24 @@ void PCB_EDIT_FRAME::ReCreateVToolbar()
PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
std::unique_ptr<ACTION_MENU> routeMenu = std::make_unique<ACTION_MENU>( false, selTool );
routeMenu->Add( PCB_ACTIONS::routerHighlightMode, ACTION_MENU::CHECK );
routeMenu->Add( PCB_ACTIONS::routerShoveMode, ACTION_MENU::CHECK );
routeMenu->Add( PCB_ACTIONS::routerWalkaroundMode, ACTION_MENU::CHECK );
auto makeRouteMenu =
[&]()
{
std::unique_ptr<ACTION_MENU> routeMenu =
std::make_unique<ACTION_MENU>( false, selTool );
routeMenu->AppendSeparator();
routeMenu->Add( PCB_ACTIONS::routerSettingsDialog );
m_drawToolBar->AddToolContextMenu( PCB_ACTIONS::routeSingleTrack, std::move( routeMenu ) );
routeMenu->Add( PCB_ACTIONS::routerHighlightMode, ACTION_MENU::CHECK );
routeMenu->Add( PCB_ACTIONS::routerShoveMode, ACTION_MENU::CHECK );
routeMenu->Add( PCB_ACTIONS::routerWalkaroundMode, ACTION_MENU::CHECK );
routeMenu->AppendSeparator();
routeMenu->Add( PCB_ACTIONS::routerSettingsDialog );
return routeMenu;
};
m_drawToolBar->AddToolContextMenu( PCB_ACTIONS::routeSingleTrack, makeRouteMenu() );
m_drawToolBar->AddToolContextMenu( PCB_ACTIONS::routeDiffPair, makeRouteMenu() );
std::unique_ptr<ACTION_MENU> zoneMenu = std::make_unique<ACTION_MENU>( false, selTool );
zoneMenu->Add( PCB_ACTIONS::zoneFillAll );