Pcbnew: fix incorrect UI behavior of "Zoom to selection" tool in GAL canvas.
This commit is contained in:
parent
a1a9440091
commit
1ada4863fc
|
@ -389,6 +389,9 @@ public:
|
|||
virtual void ReCreateMenuBar() override;
|
||||
virtual void ReCreateAuxiliaryToolbar();
|
||||
|
||||
// Toolbar accessors
|
||||
wxAuiToolBar* GetMainToolBar() const { return m_mainToolBar; }
|
||||
|
||||
/**
|
||||
* Function SetToolID
|
||||
* sets the tool command ID to \a aId and sets the cursor to \a aCursor. The
|
||||
|
|
|
@ -211,7 +211,6 @@ void PCB_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
|
|||
|
||||
void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
if( aEvent.GetEventObject() == m_drawToolBar )
|
||||
aEvent.Check( GetToolId() == aEvent.GetId() );
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,12 @@ void ZOOM_TOOL::Reset( RESET_REASON aReason )
|
|||
|
||||
int ZOOM_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
// This method is called both when the zoom tool is activated (on) or deactivated (off)
|
||||
bool zoom_tool_is_on = m_frame->GetMainToolBar()->GetToolToggled( ID_ZOOM_SELECTION );
|
||||
|
||||
if( !zoom_tool_is_on ) // This is a tool deselection: do nothing
|
||||
return 0;
|
||||
|
||||
m_frame->SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
|
||||
|
||||
while( auto evt = Wait() )
|
||||
|
@ -64,6 +70,7 @@ int ZOOM_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
m_toolMgr->PassEvent();
|
||||
}
|
||||
|
||||
// Exit zoom tool
|
||||
m_frame->SetNoToolSelected();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue