Allow toolbar items to cancel tools when pressed

There was a regression in v6 where the zoom to selection toolbar
item wasn't canceling the tool when pressed and the tool was active
(it was in v5). This implements a more generic framework for canceling
tools on button presses.

Fixes https://gitlab.com/kicad/code/kicad/issues/5103
This commit is contained in:
Ian McInerney
2020-09-05 01:49:38 +01:00
parent 7893af2c60
commit f28b60896c
12 changed files with 58 additions and 27 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->Add( ACTIONS::zoomInCenter );
m_mainToolBar->Add( ACTIONS::zoomOutCenter );
m_mainToolBar->Add( ACTIONS::zoomFitScreen );
m_mainToolBar->Add( ACTIONS::zoomTool, ACTION_TOOLBAR::TOGGLE );
m_mainToolBar->Add( ACTIONS::zoomTool, ACTION_TOOLBAR::TOGGLE, ACTION_TOOLBAR::CANCEL );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EE_ACTIONS::navigateHierarchy );