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
This commit is contained in:
Jeff Young
2018-07-20 22:21:51 +01:00
parent ea3ef1eb87
commit 2c833f2c91
2 changed files with 11 additions and 5 deletions
+1 -1
View File
@@ -3455,7 +3455,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
+10 -4
View File
@@ -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 );
}