From eb3d8dbcc80d81a2fa59193cd5283058515b4dd0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 13 Nov 2021 11:12:08 +0100 Subject: [PATCH] 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 --- pcbnew/dialogs/dialog_footprint_properties.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 58e5118462..f4a54c8dfd 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -665,6 +665,17 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& ) 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() ); aEvent.Skip();