From 2c833f2c9115d281534b1957cf1542f054fabc19 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 20 Jul 2018 22:21:05 +0100 Subject: [PATCH] Fix layout issues in Copper Zones dialog. (The list width issue probably also affects other zone dialogs.) Fixes: lp:1782766 * https://bugs.launchpad.net/kicad/+bug/1782766 --- pcbnew/dialogs/dialog_copper_zones_base.fbp | 2 +- pcbnew/zone_settings.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp index a71e534112..8d7605bc32 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.fbp +++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp @@ -3455,7 +3455,7 @@ none 10 - wxEXPAND|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index c9e01ac09c..f731a64681 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -151,7 +151,11 @@ void ZONE_SETTINGS::SetCornerRadius( int aRadius ) } -const static wxSize LAYER_BITMAP_SIZE( 28, 28 ); // Mac unhappy if this isn't square... +#ifdef __WXOSX_MAC__ +const static wxSize LAYER_BITMAP_SIZE( 28, 28 ); // wxCocoa impl unhappy if this isn't square... +#else +const static wxSize LAYER_BITMAP_SIZE( 20, 10 ); +#endif // A helper for setting up a dialog list for specifying zone layers. Used by all three // zone settings dialogs. @@ -194,14 +198,16 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* } checkColumn->SetWidth( 25 ); - layerColumn->SetMinWidth( minWidth + LAYER_BITMAP_SIZE.x + 25 ); + layerColumn->SetWidth( minWidth + LAYER_BITMAP_SIZE.x + 25 ); // 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 ); - minWidth = checkColumn->GetWidth() + layerColumn->GetWidth(); - aList->SetMinSize( wxSize( minWidth, aList->GetMinSize().GetHeight() ) ); + wxSize minSize = wxSize( checkColumn->GetWidth() + layerColumn->GetWidth() + 4, + aList->GetMinSize().GetHeight() ); + aList->SetSize( minSize ); + aList->SetMinSize( minSize ); }