Make MMB double click perform 'Zoom to Fit'

ADDED: Make middle mouse button double click do a 'Zoom to Fit'
in Eeschema, Pcbnew, and Gerbview.  Ctrl-MMB does a 'Zoom to Objects'
in Eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/1988
This commit is contained in:
PJM 2020-09-16 17:19:31 -07:00 committed by Seth Hillbrand
parent f47d81af85
commit e77b7e3360
3 changed files with 21 additions and 0 deletions

View File

@ -360,6 +360,15 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_toolMgr->RunAction( EE_ACTIONS::properties );
}
// Middle double click? Do zoom to fit or zoom to objects
else if( evt->IsDblClick( BUT_MIDDLE ) )
{
if( m_exclusive_or ) // Is CTRL key down?
m_toolMgr->RunAction( ACTIONS::zoomFitObjects, true );
else
m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true );
}
// drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
else if( evt->IsDrag( BUT_LEFT ) )
{

View File

@ -214,6 +214,12 @@ int GERBVIEW_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_menu.ShowContextMenu( m_selection );
}
// Middle double click? Do zoom to fit
else if( evt->IsDblClick( BUT_MIDDLE ) )
{
m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true );
}
else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE )
{
clearSelection();

View File

@ -274,6 +274,12 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
}
}
// Middle double click? Do zoom to fit
else if( evt->IsDblClick( BUT_MIDDLE ) )
{
m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true );
}
// drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
else if( evt->IsDrag( BUT_LEFT ) )
{