DIALOG_FOOTPRINT_PROPERTIES: fix an issue when a layer selector widget is selected.

When resisting the dialog, the widget was not moved.
Fixes #9617
https://gitlab.com/kicad/code/kicad/issues/9617
This commit is contained in:
jean-pierre charras 2021-11-13 11:12:08 +01:00
parent bfd09a4d16
commit eb3d8dbcc8
1 changed files with 11 additions and 0 deletions

View File

@ -665,6 +665,17 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& )
void DIALOG_FOOTPRINT_PROPERTIES::OnGridSize( wxSizeEvent& aEvent ) void DIALOG_FOOTPRINT_PROPERTIES::OnGridSize( wxSizeEvent& aEvent )
{ {
// A trick to fix a cosmetic issue: when, in m_itemsGrid, a layer selector widget
// has the focus (is activated in column 6) when resizing the grid, the widget
// is not moved. So just change the widget having the focus in this case
if( m_NoteBook->GetSelection() == 0 && !m_itemsGrid->HasFocus() )
{
int col = m_itemsGrid->GetGridCursorCol();
if( col == 6 ) // a layer selector widget can be activated
m_itemsGrid->SetFocus();
}
adjustGridColumns( aEvent.GetSize().GetX() ); adjustGridColumns( aEvent.GetSize().GetX() );
aEvent.Skip(); aEvent.Skip();