Keep focus on filter boxes in footprint viewer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4884
This commit is contained in:
parent
a1b4bcc210
commit
52e2bf0000
|
@ -630,6 +630,8 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& aEvent )
|
|||
if( getCurNickname() == name )
|
||||
return;
|
||||
|
||||
bool filterFocus = m_libFilter->HasFocus();
|
||||
|
||||
setCurNickname( name );
|
||||
|
||||
ReCreateFootprintList();
|
||||
|
@ -639,6 +641,10 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& aEvent )
|
|||
// to navigate inside the list.
|
||||
// the gal canvas must not steal the focus to allow navigation
|
||||
GetCanvas()->SetStealsFocus( false );
|
||||
|
||||
if( filterFocus )
|
||||
m_libFilter->SetFocus();
|
||||
else
|
||||
m_libList->SetFocus();
|
||||
}
|
||||
|
||||
|
@ -653,6 +659,8 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& aEvent )
|
|||
if( ii < 0 )
|
||||
return;
|
||||
|
||||
bool filterFocus = m_fpFilter->HasFocus();
|
||||
|
||||
wxString name = m_fpList->GetString( ii );
|
||||
|
||||
if( getCurFootprintName().CmpNoCase( name ) != 0 )
|
||||
|
@ -694,6 +702,10 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& aEvent )
|
|||
// to navigate inside the list.
|
||||
// the gal canvas must not steal the focus to allow navigation
|
||||
GetCanvas()->SetStealsFocus( false );
|
||||
|
||||
if( filterFocus )
|
||||
m_fpFilter->SetFocus();
|
||||
else
|
||||
m_fpList->SetFocus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue