diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index 0cd9484552..eb9937fc4a 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -191,7 +191,7 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo wxSize APPEARANCE_CONTROLS::GetBestSize() const { - wxSize size( 240, 480 ); + wxSize size( 220, 480 ); // TODO(JE) appropriate logic return size; } @@ -492,8 +492,9 @@ void APPEARANCE_CONTROLS::rebuildLayers() LSET enabled = board->GetEnabledLayers(); LSET visible = board->GetVisibleLayers(); - COLOR_SETTINGS* theme = m_frame->GetColorSettings(); - COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND ); + COLOR_SETTINGS* theme = m_frame->GetColorSettings(); + COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND ); + bool firstLayer = true; m_layerSettings.clear(); m_layers_outer_sizer->Clear( true ); @@ -527,10 +528,17 @@ void APPEARANCE_CONTROLS::rebuildLayers() label->Wrap( -1 ); label->SetToolTip( aSetting->tooltip ); - sizer->Add( indicator, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 ); - sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 ); - sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 ); - sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 ); + int topMargin = firstLayer ? 2 : 1; + firstLayer = false; + + sizer->AddSpacer( 1 ); + sizer->Add( indicator, 0, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); + sizer->AddSpacer( 5 ); + sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); + sizer->AddSpacer( 6 ); + sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); + sizer->AddSpacer( 5 ); + sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); m_layers_outer_sizer->Add( panel, 0, wxEXPAND, 0 ); @@ -991,7 +999,7 @@ void APPEARANCE_CONTROLS::rebuildObjects() "right click for menu" ) ); m_objectsSizer->Add( swatch, wxGBPosition( aRow, 0 ), wxDefaultSpan, - wxALIGN_CENTER_VERTICAL | wxEXPAND | topMargin | wxLEFT | wxRIGHT, 3 ); + wxALIGN_CENTER_VERTICAL | wxEXPAND | topMargin | wxLEFT | wxRIGHT, 1 ); aSetting->ctl_color = swatch; swatch->Bind( COLOR_SWATCH_CHANGED, @@ -1007,7 +1015,7 @@ void APPEARANCE_CONTROLS::rebuildObjects() btn_visible->SetToolTip( tip ); m_objectsSizer->Add( btn_visible, wxGBPosition( aRow, 1 ), wxDefaultSpan, - sliderLableAlignment | topMargin | wxLEFT | wxRIGHT, 3 ); + sliderLableAlignment | topMargin | wxLEFT, 1 ); aSetting->ctl_visibility = btn_visible; btn_visible->Bind( TOGGLE_CHANGED, @@ -1025,7 +1033,7 @@ void APPEARANCE_CONTROLS::rebuildObjects() wxGBSpan labelSpan( 1, aSetting->can_control_opacity ? 1 : 2 ); m_objectsSizer->Add( label, wxGBPosition( aRow, 2 ), labelSpan, - sliderLableAlignment | topMargin | wxLEFT | wxRIGHT, 3 ); + sliderLableAlignment | topMargin | wxLEFT | wxRIGHT, 1 ); if( aSetting->can_control_opacity ) { @@ -1042,7 +1050,7 @@ void APPEARANCE_CONTROLS::rebuildObjects() slider->SetToolTip( tip ); m_objectsSizer->Add( slider, wxGBPosition( aRow, 3 ), wxDefaultSpan, - sliderAlignment | topMargin | wxLEFT | wxRIGHT | wxEXPAND, 3 ); + sliderAlignment | topMargin | wxLEFT | wxRIGHT | wxEXPAND, 1 ); aSetting->ctl_opacity = slider; auto opacitySliderHandler = diff --git a/pcbnew/widgets/appearance_controls_base.cpp b/pcbnew/widgets/appearance_controls_base.cpp index ed8b9fd505..b6d3363bc9 100644 --- a/pcbnew/widgets/appearance_controls_base.cpp +++ b/pcbnew/widgets/appearance_controls_base.cpp @@ -30,7 +30,7 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_windowLayers->SetSizer( m_layers_outer_sizer ); m_windowLayers->Layout(); m_layers_outer_sizer->Fit( m_windowLayers ); - m_panelLayersSizer->Add( m_windowLayers, 1, wxEXPAND|wxTOP, 5 ); + m_panelLayersSizer->Add( m_windowLayers, 1, wxEXPAND, 5 ); m_paneLayerDisplay = new wxCollapsiblePane( m_panelLayers, wxID_ANY, wxT("Layer Display Options"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE ); m_paneLayerDisplay->Collapse( true ); @@ -74,13 +74,13 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_paneLayerDisplay->GetPane()->SetSizer( bSizer121 ); m_paneLayerDisplay->GetPane()->Layout(); bSizer121->Fit( m_paneLayerDisplay->GetPane() ); - m_panelLayersSizer->Add( m_paneLayerDisplay, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + m_panelLayersSizer->Add( m_paneLayerDisplay, 0, wxEXPAND|wxTOP, 5 ); m_panelLayers->SetSizer( m_panelLayersSizer ); m_panelLayers->Layout(); m_panelLayersSizer->Fit( m_panelLayers ); - m_notebook->AddPage( m_panelLayers, wxT("Layers"), true ); + m_notebook->AddPage( m_panelLayers, wxT("Layers"), false ); m_panelObjects = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelObjects->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); @@ -93,12 +93,12 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID wxBoxSizer* bSizer161; bSizer161 = new wxBoxSizer( wxVERTICAL ); - m_objectsSizer = new wxGridBagSizer( 0, 0 ); + m_objectsSizer = new wxGridBagSizer( 0, 4 ); m_objectsSizer->SetFlexibleDirection( wxBOTH ); m_objectsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - bSizer161->Add( m_objectsSizer, 1, wxEXPAND|wxALL, 2 ); + bSizer161->Add( m_objectsSizer, 1, wxEXPAND|wxALL, 5 ); m_windowObjects->SetSizer( bSizer161 ); @@ -242,7 +242,7 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_panelNetsAndClasses->SetSizer( bSizer16 ); m_panelNetsAndClasses->Layout(); bSizer16->Fit( m_panelNetsAndClasses ); - m_notebook->AddPage( m_panelNetsAndClasses, wxT("Nets"), false ); + m_notebook->AddPage( m_panelNetsAndClasses, wxT("Nets"), true ); m_sizerOuter->Add( m_notebook, 1, wxEXPAND, 5 ); @@ -253,13 +253,13 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID int m_cbLayerPresetsNChoices = sizeof( m_cbLayerPresetsChoices ) / sizeof( wxString ); m_cbLayerPresets = new wxChoice( presetsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbLayerPresetsNChoices, m_cbLayerPresetsChoices, 0 ); m_cbLayerPresets->SetSelection( 1 ); - presetsSizer->Add( m_cbLayerPresets, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + presetsSizer->Add( m_cbLayerPresets, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_btnDeletePreset = new wxBitmapButton( presetsSizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); m_btnDeletePreset->Enable( false ); m_btnDeletePreset->SetToolTip( wxT("Delete this layer preset") ); - presetsSizer->Add( m_btnDeletePreset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + presetsSizer->Add( m_btnDeletePreset, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_sizerOuter->Add( presetsSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); diff --git a/pcbnew/widgets/appearance_controls_base.fbp b/pcbnew/widgets/appearance_controls_base.fbp index 4240bc458b..a310c1e45b 100644 --- a/pcbnew/widgets/appearance_controls_base.fbp +++ b/pcbnew/widgets/appearance_controls_base.fbp @@ -115,7 +115,7 @@ Layers - 1 + 0 1 1 @@ -174,7 +174,7 @@ protected 5 - wxEXPAND|wxTOP + wxEXPAND 1 1 @@ -239,7 +239,7 @@ 5 - wxBOTTOM|wxEXPAND|wxTOP + wxEXPAND|wxTOP 0 1 @@ -821,7 +821,7 @@ wxVERTICAL none - 2 + 5 wxEXPAND|wxALL 1 @@ -829,7 +829,7 @@ wxBOTH - 0 + 4 m_objectsSizer wxFLEX_GROWMODE_SPECIFIED @@ -846,7 +846,7 @@ Nets - 0 + 1 1 1 @@ -1922,7 +1922,7 @@ none 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT 1 1 @@ -1987,7 +1987,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL 0 1