Browse Source

Fix selection tool behavior in footprint viewer

The footprint viewer isn't an edit frame, so we need to access the
settings through the base frame type instead. Also, double click makes
no sense in the footprint viewer, and just leads to weird results
sometimes.

Fixes Sentry KICAD-7A2
newinvert
Ian McInerney 3 years ago
parent
commit
7ea1568802
  1. 7
      pcbnew/tools/pcb_selection_tool.cpp
  2. 7
      pcbnew/tools/pcb_selection_tool.h

7
pcbnew/tools/pcb_selection_tool.cpp

@ -354,6 +354,13 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
m_disambiguateTimer.Stop();
// Double clicks make no sense in the footprint viewer
if( frame && frame->IsType( FRAME_FOOTPRINT_VIEWER ) )
{
evt->SetPassEvent();
continue;
}
// Double click? Display the properties window
m_frame->FocusOnItem( nullptr );

7
pcbnew/tools/pcb_selection_tool.h

@ -232,7 +232,12 @@ protected:
return getViewControls();
}
PCB_BASE_EDIT_FRAME* frame() const
PCB_BASE_FRAME* frame() const
{
return getEditFrame<PCB_BASE_FRAME>();
}
PCB_BASE_EDIT_FRAME* editFrame() const
{
return getEditFrame<PCB_BASE_EDIT_FRAME>();
}

Loading…
Cancel
Save