From bc0a7532382e0455dd18f5f448de19e959ddb395 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 14 Nov 2022 18:46:39 +0000 Subject: [PATCH] Slight improvement to overly-wide checkbox columns. --- eeschema/dialogs/dialog_symbol_fields_table.cpp | 6 ++++-- pcbnew/dialogs/dialog_plot.cpp | 12 ++++++------ pcbnew/zone_settings.cpp | 10 +++++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 45f4d68680..566c75ba14 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -1337,8 +1337,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event ) int nameColWidth = KIPLATFORM::UI::GetUnobscuredSize( m_fieldsCtrl ).x; nameColWidth -= m_showColWidth + m_groupByColWidth; #ifdef __WXMAC__ - // TODO: something in wxWidgets 3.1.x makes checkboxes really wide... - nameColWidth -= 40; + // TODO: something in wxWidgets 3.1.x pads checkbox columns with extra space. (It used to + // also be that the width of the column would get set too wide (to 30), but that's patched in + // our local wxWidgets fork.) + nameColWidth -= 30; #endif // GTK loses its head and messes these up when resizing the splitter bar: diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 1746061e44..f3e591e5bf 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -120,13 +120,13 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) : int layerColSize = textWidth + 15; #ifdef __WXMAC__ - // TODO: something in wxWidgets 3.1.x makes checkbox padding really large... - int checkColMargins = 40; -#else - int checkColMargins = 0; + // TODO: something in wxWidgets 3.1.x pads checkbox columns with extra space. (It used to + // also be that the width of the column would get set too wide (to 30), but that's patched in + // our local wxWidgets fork.) + checkColSize += 30; #endif - m_layerCheckListBox->SetMinClientSize( wxSize( checkColSize + checkColMargins + layerColSize, + m_layerCheckListBox->SetMinClientSize( wxSize( checkColSize + layerColSize, m_layerCheckListBox->GetMinClientSize().y ) ); wxStaticBox* allLayersLabel = new wxStaticBox( this, wxID_ANY, _( "Plot on All Layers" ) ); @@ -136,7 +136,7 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) : wxDefaultPosition, wxDefaultSize, plotAllLayersOrder, plotAllLayersChoicesStrings, 0 ); - m_plotAllLayersList->SetMinClientSize( wxSize( checkColSize + checkColMargins + layerColSize, + m_plotAllLayersList->SetMinClientSize( wxSize( checkColSize + layerColSize, m_plotAllLayersList->GetMinClientSize().y ) ); // Attach the LAYER_ID to each item in m_plotAllLayersList diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index 3e8382a064..a924fbbf5b 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -246,16 +246,16 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* int layerColSize = textWidth + LAYER_BITMAP_SIZE.x + 15; #ifdef __WXMAC__ - // TODO: something in wxWidgets 3.1.x makes checkbox padding really large... - int checkColMargins = 40; -#else - int checkColMargins = 0; + // TODO: something in wxWidgets 3.1.x pads checkbox columns with extra space. (It used to + // also be that the width of the column would get set too wide (to 30), but that's patched in + // our local wxWidgets fork.) + checkColSize += 30; #endif // You'd think the fact that m_layers is a list would encourage wxWidgets not to save room // for the tree expanders... but you'd be wrong. Force indent to 0. aList->SetIndent( 0 ); - aList->SetMinClientSize( wxSize( checkColSize + checkColMargins + layerColSize, + aList->SetMinClientSize( wxSize( checkColSize + layerColSize, aList->GetMinClientSize().y ) ); checkColumn->SetWidth( checkColSize );