From d871a92d1c5337b3029e773c820ec996c07d9ad0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 3 May 2020 20:23:41 +0200 Subject: [PATCH] library viewers: fix a focus issue that prevent using arrow keys in lib or fp lists. Once the gal canvas hsad the focus, it was not possible to use arrow keys in library or symbols or fp lists even after clicking on an item. This focus issue is now fixed. From the fix in Master --- eeschema/viewlib_frame.cpp | 12 ++++++++++++ pcbnew/footprint_viewer_frame.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 174a44304b..df3ca2b0b9 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -621,6 +621,12 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event ) m_selection_changed = true; SetSelectedLibrary( m_libList->GetString( ii ) ); + + // The m_libList has now the focus, in order to be able to use arrow keys + // to navigate inside the list. + // the gal canvas must not steal the focus to allow navigation + GetGalCanvas()->SetStealsFocus( false ); + m_libList->SetFocus(); } @@ -651,6 +657,12 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event ) m_selection_changed = true; SetSelectedComponent( m_cmpList->GetString( ii ) ); + + // The m_cmpList has now the focus, in order to be able to use arrow keys + // to navigate inside the list. + // the gal canvas must not steal the focus to allow navigation + GetGalCanvas()->SetStealsFocus( false ); + m_cmpList->SetFocus(); } diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index e000794689..eeac27876b 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -403,6 +403,12 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event ) ReCreateFootprintList(); UpdateTitle(); + + // The m_libList has now the focus, in order to be able to use arrow keys + // to navigate inside the list. + // the gal canvas must not steal the focus to allow navigation + GetGalCanvas()->SetStealsFocus( false ); + m_libList->SetFocus(); } @@ -453,6 +459,12 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event ) m_canvas->Refresh(); Update3D_Frame(); } + + // The m_footprintList has now the focus, in order to be able to use arrow keys + // to navigate inside the list. + // the gal canvas must not steal the focus to allow navigation + GetGalCanvas()->SetStealsFocus( false ); + m_footprintList->SetFocus(); }