Don't allow preview canvases to steal focus when keyboard navigating preferences tree.
Fixes https://gitlab.com/kicad/code/kicad/issues/10407
This commit is contained in:
parent
6eb7c176a7
commit
52ea9d0bc5
|
@ -335,9 +335,6 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
|
||||||
{
|
{
|
||||||
if( aEvent.GetKeyCode() == WXK_UP )
|
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();
|
int page = m_treebook->GetSelection();
|
||||||
|
|
||||||
if( page >= 1 )
|
if( page >= 1 )
|
||||||
|
@ -347,6 +344,16 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
|
||||||
else
|
else
|
||||||
m_treebook->SetSelection( page - 1 );
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue