One more attempt to get the layers list width right on GTK.

Fixes: lp:1782766
* https://bugs.launchpad.net/kicad/+bug/1782766
This commit is contained in:
Jeff Young 2018-07-21 14:42:32 +01:00
parent 86d98ee7fd
commit 833e0b3c0f
5 changed files with 26 additions and 12 deletions

View File

@ -112,6 +112,7 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS*
m_ptr = aSettings;
m_settings = *aSettings;
m_settings.SetupLayersList( m_layers, m_Parent, true );
int layersWidth = m_layers->GetColumn( 0 )->GetWidth() + m_layers->GetColumn( 1 )->GetWidth();
m_settingsExported = false;
@ -120,7 +121,13 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS*
m_sdbSizerOK->SetDefault();
FinishDialogSettings();
GetSizer()->SetSizeHints( this );
// Must be done after SetSizeHints() else GTK will overwrite it
m_layers->SetMinSize( wxSize( layersWidth + 4, m_layers->GetMinSize().y ) );
// the default position, when calling the first time the dlg
Center();
}

View File

@ -249,7 +249,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_ExportSetupButton = new wxButton( this, wxID_BUTTON_EXPORT, _("Export Settings to Other Zones"), wxDefaultPosition, wxDefaultSize, 0 );
m_ExportSetupButton->SetToolTip( _("Export this zone setup (excluding layer and net selection) to all other copper zones.") );
bSizerbottom->Add( m_ExportSetupButton, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
bSizerbottom->Add( m_ExportSetupButton, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 10 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );

View File

@ -69,12 +69,18 @@ DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME*
m_ptr = aSettings;
m_zonesettings = *aSettings;
m_zonesettings.SetupLayersList( m_layers, m_parent, true );
int layersWidth = m_layers->GetColumn( 0 )->GetWidth() + m_layers->GetColumn( 1 )->GetWidth();
m_sdbSizerButtonsOK->SetDefault();
FinishDialogSettings();
GetSizer()->SetSizeHints( this );
// Must be done after SetSizeHints() else GTK will overwrite it
m_layers->SetMinSize( wxSize( layersWidth + 4, m_layers->GetMinSize().y ) );
// the default position, when calling the first time the dlg
Center();
}

View File

@ -72,10 +72,16 @@ DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR( PCB_BASE_FRAME*
m_ptr = aSettings;
m_settings = *aSettings;
m_settings.SetupLayersList( m_layers, m_parent, false );
int layersWidth = m_layers->GetColumn( 0 )->GetWidth() + m_layers->GetColumn( 1 )->GetWidth();
FinishDialogSettings();
GetSizer()->SetSizeHints( this );
// Must be done after SetSizeHints() else GTK will overwrite it
m_layers->SetMinSize( wxSize( layersWidth + 4, m_layers->GetMinSize().y ) );
// the default position, when calling the first time the dlg
Center();
}

View File

@ -154,7 +154,7 @@ void ZONE_SETTINGS::SetCornerRadius( int aRadius )
#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 );
const static wxSize LAYER_BITMAP_SIZE( 24, 18 );
#endif
// A helper for setting up a dialog list for specifying zone layers. Used by all three
@ -203,11 +203,6 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME*
// 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 );
wxSize minSize = wxSize( checkColumn->GetWidth() + layerColumn->GetWidth() + 4,
aList->GetMinSize().GetHeight() );
aList->SetSize( minSize );
aList->SetMinSize( minSize );
}