Clear toolstack after cancel.

Fixes https://gitlab.com/kicad/code/kicad/issues/5336
This commit is contained in:
Jeff Young 2020-08-24 19:28:26 +01:00
parent d5878e552d
commit a4ff339a1e
3 changed files with 11 additions and 2 deletions

View File

@ -96,6 +96,13 @@ void TOOLS_HOLDER::PopTool( const std::string& actionName )
}
void TOOLS_HOLDER::ClearToolStack()
{
m_toolStack.clear();
DisplayToolMsg( ACTIONS::selectionTool.GetLabel() );
}
std::string TOOLS_HOLDER::CurrentToolName() const
{
if( m_toolStack.empty() )

View File

@ -114,6 +114,8 @@ public:
virtual void PushTool( const std::string& actionName );
virtual void PopTool( const std::string& actionName );
void ClearToolStack();
bool ToolStackIsEmpty() { return m_toolStack.empty(); }
std::string CurrentToolName() const;

View File

@ -381,7 +381,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
if( unselect )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
editFrame->PopTool( tool );
editFrame->ClearToolStack();
return 0;
}