From 724262651f8b0c0d388a4643332175c4f8014367 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 11 Apr 2023 18:38:03 +0200 Subject: [PATCH] manage libraries dialog: show new state of widgets as soon as the context-menu activate/deactivate changes their state From master branch Fixes #14517 https://gitlab.com/kicad/code/kicad/issues/14517 --- common/lib_table_grid_tricks.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/lib_table_grid_tricks.cpp b/common/lib_table_grid_tricks.cpp index 1d2fed1de7..8d19768344 100644 --- a/common/lib_table_grid_tricks.cpp +++ b/common/lib_table_grid_tricks.cpp @@ -61,10 +61,13 @@ void LIB_TABLE_GRID_TRICKS::doPopupSelection( wxCommandEvent& event ) { LIB_TABLE_GRID* tbl = (LIB_TABLE_GRID*) m_grid->GetTable(); + bool selected_state = menu_id == LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED; + for( int row = m_sel_row_start; row < m_sel_row_start + m_sel_row_count; ++row ) - { - tbl->SetValueAsBool( row, 0, menu_id == LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED ); - } + tbl->SetValueAsBool( row, 0, selected_state ); + + // Ensure the new state (on/off) of the widgets is immediately shown: + m_grid->Refresh(); } else {