Browse Source

Don't allow preview canvases to steal focus when keyboard navigating preferences tree.

Fixes https://gitlab.com/kicad/code/kicad/issues/10407
7.0
Jeff Young 3 years ago
parent
commit
52ea9d0bc5
  1. 13
      common/widgets/paged_dialog.cpp

13
common/widgets/paged_dialog.cpp

@ -335,9 +335,6 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
{
if( aEvent.GetKeyCode() == WXK_UP )
{
// We have to special-case WXK_UP as when wxWidgets attempts to select the header we'll
// go down to its first child again.
int page = m_treebook->GetSelection();
if( page >= 1 )
@ -347,6 +344,16 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
else
m_treebook->SetSelection( page - 1 );
}
m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal focus
}
else if( aEvent.GetKeyCode() == WXK_DOWN )
{
int page = m_treebook->GetSelection();
m_treebook->SetSelection( std::min<int>( page + 1, m_treebook->GetPageCount() - 1 ) );
m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal focus
}
else
{

Loading…
Cancel
Save