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 std::string TOOLS_HOLDER::CurrentToolName() const
{ {
if( m_toolStack.empty() ) if( m_toolStack.empty() )

View File

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

View File

@ -381,7 +381,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
if( unselect ) if( unselect )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
editFrame->PopTool( tool ); editFrame->ClearToolStack();
return 0; return 0;
} }
@ -1656,7 +1656,7 @@ int EDIT_TOOL::copyToClipboard( const TOOL_EVENT& aEvent )
VECTOR2I refPoint; VECTOR2I refPoint;
bool rv = pickReferencePoint( _( "Select reference point for the copy..." ), bool rv = pickReferencePoint( _( "Select reference point for the copy..." ),
_( "Selection copied." ), _( "Copy cancelled." ), refPoint ); _( "Selection copied." ), _( "Copy cancelled." ), refPoint );
frame()->SetMsgPanel( board() ); frame()->SetMsgPanel( board() );
if( !rv ) if( !rv )