Browse Source

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
pull/16/head
PJM 5 years ago
committed by Seth Hillbrand
parent
commit
e77b7e3360
  1. 9
      eeschema/tools/ee_selection_tool.cpp
  2. 6
      gerbview/tools/gerbview_selection_tool.cpp
  3. 6
      pcbnew/tools/selection_tool.cpp

9
eeschema/tools/ee_selection_tool.cpp

@ -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 ) )
{

6
gerbview/tools/gerbview_selection_tool.cpp

@ -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();

6
pcbnew/tools/selection_tool.cpp

@ -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 ) )
{

Loading…
Cancel
Save