From dc5ae574e266e83aa4a1607c5294131ff6f02cda Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 17 Feb 2019 14:09:35 +0000 Subject: [PATCH] Restore ability to hide grid columns. wxGrids stupidly does this by setting the width to zero, so you have to be careful when adjusting minimum widths. --- pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp | 3 ++- pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp | 3 ++- pcbnew/dialogs/panel_modedit_defaults.cpp | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp index 8b85ce52d1..76f5bedb07 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp @@ -387,7 +387,8 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow() if( col == 6 ) col_size += 20; - m_itemsGrid->SetColSize( col, col_size ); + if( m_itemsGrid->IsColShown( col ) ) + m_itemsGrid->SetColSize( col, col_size ); } m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, false, true, true ) ); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index 568cfd0028..821e7a35dd 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -303,7 +303,8 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow() if( col == 6 ) col_size += 20; - m_itemsGrid->SetColSize( col, col_size ); + if( m_itemsGrid->IsColShown( col ) ) + m_itemsGrid->SetColSize( col, col_size ); } m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, true, true, true ) ); diff --git a/pcbnew/dialogs/panel_modedit_defaults.cpp b/pcbnew/dialogs/panel_modedit_defaults.cpp index 65b0888540..5fb003e94a 100644 --- a/pcbnew/dialogs/panel_modedit_defaults.cpp +++ b/pcbnew/dialogs/panel_modedit_defaults.cpp @@ -130,8 +130,10 @@ bool PANEL_MODEDIT_DEFAULTS::TransferDataToWindow() { // Set the minimal width to the column label size. m_grid->SetColMinimalWidth( col, m_grid->GetVisibleWidth( col, true, false, false ) ); + // Set the width to see the full contents - m_grid->SetColSize( col, m_grid->GetVisibleWidth( col, true, true, true ) ); + if( m_grid->IsColShown( col ) ) + m_grid->SetColSize( col, m_grid->GetVisibleWidth( col, true, true, true ) ); } m_grid->SetRowLabelSize( m_grid->GetVisibleWidth( -1, true, true, true ) );