More spacing adjustments for appearance manager.
This commit is contained in:
parent
5938528a16
commit
e5f2015a9c
|
@ -191,7 +191,7 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
|
||||||
|
|
||||||
wxSize APPEARANCE_CONTROLS::GetBestSize() const
|
wxSize APPEARANCE_CONTROLS::GetBestSize() const
|
||||||
{
|
{
|
||||||
wxSize size( 240, 480 );
|
wxSize size( 220, 480 );
|
||||||
// TODO(JE) appropriate logic
|
// TODO(JE) appropriate logic
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
@ -492,8 +492,9 @@ void APPEARANCE_CONTROLS::rebuildLayers()
|
||||||
LSET enabled = board->GetEnabledLayers();
|
LSET enabled = board->GetEnabledLayers();
|
||||||
LSET visible = board->GetVisibleLayers();
|
LSET visible = board->GetVisibleLayers();
|
||||||
|
|
||||||
COLOR_SETTINGS* theme = m_frame->GetColorSettings();
|
COLOR_SETTINGS* theme = m_frame->GetColorSettings();
|
||||||
COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND );
|
COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND );
|
||||||
|
bool firstLayer = true;
|
||||||
|
|
||||||
m_layerSettings.clear();
|
m_layerSettings.clear();
|
||||||
m_layers_outer_sizer->Clear( true );
|
m_layers_outer_sizer->Clear( true );
|
||||||
|
@ -527,10 +528,17 @@ void APPEARANCE_CONTROLS::rebuildLayers()
|
||||||
label->Wrap( -1 );
|
label->Wrap( -1 );
|
||||||
label->SetToolTip( aSetting->tooltip );
|
label->SetToolTip( aSetting->tooltip );
|
||||||
|
|
||||||
sizer->Add( indicator, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 );
|
int topMargin = firstLayer ? 2 : 1;
|
||||||
sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 );
|
firstLayer = false;
|
||||||
sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 );
|
|
||||||
sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxTOP, 2 );
|
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 );
|
m_layers_outer_sizer->Add( panel, 0, wxEXPAND, 0 );
|
||||||
|
|
||||||
|
@ -991,7 +999,7 @@ void APPEARANCE_CONTROLS::rebuildObjects()
|
||||||
"right click for menu" ) );
|
"right click for menu" ) );
|
||||||
|
|
||||||
m_objectsSizer->Add( swatch, wxGBPosition( aRow, 0 ), wxDefaultSpan,
|
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;
|
aSetting->ctl_color = swatch;
|
||||||
|
|
||||||
swatch->Bind( COLOR_SWATCH_CHANGED,
|
swatch->Bind( COLOR_SWATCH_CHANGED,
|
||||||
|
@ -1007,7 +1015,7 @@ void APPEARANCE_CONTROLS::rebuildObjects()
|
||||||
btn_visible->SetToolTip( tip );
|
btn_visible->SetToolTip( tip );
|
||||||
|
|
||||||
m_objectsSizer->Add( btn_visible, wxGBPosition( aRow, 1 ), wxDefaultSpan,
|
m_objectsSizer->Add( btn_visible, wxGBPosition( aRow, 1 ), wxDefaultSpan,
|
||||||
sliderLableAlignment | topMargin | wxLEFT | wxRIGHT, 3 );
|
sliderLableAlignment | topMargin | wxLEFT, 1 );
|
||||||
aSetting->ctl_visibility = btn_visible;
|
aSetting->ctl_visibility = btn_visible;
|
||||||
|
|
||||||
btn_visible->Bind( TOGGLE_CHANGED,
|
btn_visible->Bind( TOGGLE_CHANGED,
|
||||||
|
@ -1025,7 +1033,7 @@ void APPEARANCE_CONTROLS::rebuildObjects()
|
||||||
wxGBSpan labelSpan( 1, aSetting->can_control_opacity ? 1 : 2 );
|
wxGBSpan labelSpan( 1, aSetting->can_control_opacity ? 1 : 2 );
|
||||||
|
|
||||||
m_objectsSizer->Add( label, wxGBPosition( aRow, 2 ), labelSpan,
|
m_objectsSizer->Add( label, wxGBPosition( aRow, 2 ), labelSpan,
|
||||||
sliderLableAlignment | topMargin | wxLEFT | wxRIGHT, 3 );
|
sliderLableAlignment | topMargin | wxLEFT | wxRIGHT, 1 );
|
||||||
|
|
||||||
if( aSetting->can_control_opacity )
|
if( aSetting->can_control_opacity )
|
||||||
{
|
{
|
||||||
|
@ -1042,7 +1050,7 @@ void APPEARANCE_CONTROLS::rebuildObjects()
|
||||||
slider->SetToolTip( tip );
|
slider->SetToolTip( tip );
|
||||||
|
|
||||||
m_objectsSizer->Add( slider, wxGBPosition( aRow, 3 ), wxDefaultSpan,
|
m_objectsSizer->Add( slider, wxGBPosition( aRow, 3 ), wxDefaultSpan,
|
||||||
sliderAlignment | topMargin | wxLEFT | wxRIGHT | wxEXPAND, 3 );
|
sliderAlignment | topMargin | wxLEFT | wxRIGHT | wxEXPAND, 1 );
|
||||||
aSetting->ctl_opacity = slider;
|
aSetting->ctl_opacity = slider;
|
||||||
|
|
||||||
auto opacitySliderHandler =
|
auto opacitySliderHandler =
|
||||||
|
|
|
@ -30,7 +30,7 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID
|
||||||
m_windowLayers->SetSizer( m_layers_outer_sizer );
|
m_windowLayers->SetSizer( m_layers_outer_sizer );
|
||||||
m_windowLayers->Layout();
|
m_windowLayers->Layout();
|
||||||
m_layers_outer_sizer->Fit( m_windowLayers );
|
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 = new wxCollapsiblePane( m_panelLayers, wxID_ANY, wxT("Layer Display Options"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE );
|
||||||
m_paneLayerDisplay->Collapse( true );
|
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()->SetSizer( bSizer121 );
|
||||||
m_paneLayerDisplay->GetPane()->Layout();
|
m_paneLayerDisplay->GetPane()->Layout();
|
||||||
bSizer121->Fit( m_paneLayerDisplay->GetPane() );
|
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->SetSizer( m_panelLayersSizer );
|
||||||
m_panelLayers->Layout();
|
m_panelLayers->Layout();
|
||||||
m_panelLayersSizer->Fit( m_panelLayers );
|
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 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
m_panelObjects->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
|
m_panelObjects->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
|
||||||
|
|
||||||
|
@ -93,12 +93,12 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID
|
||||||
wxBoxSizer* bSizer161;
|
wxBoxSizer* bSizer161;
|
||||||
bSizer161 = new wxBoxSizer( wxVERTICAL );
|
bSizer161 = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_objectsSizer = new wxGridBagSizer( 0, 0 );
|
m_objectsSizer = new wxGridBagSizer( 0, 4 );
|
||||||
m_objectsSizer->SetFlexibleDirection( wxBOTH );
|
m_objectsSizer->SetFlexibleDirection( wxBOTH );
|
||||||
m_objectsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
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 );
|
m_windowObjects->SetSizer( bSizer161 );
|
||||||
|
@ -242,7 +242,7 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID
|
||||||
m_panelNetsAndClasses->SetSizer( bSizer16 );
|
m_panelNetsAndClasses->SetSizer( bSizer16 );
|
||||||
m_panelNetsAndClasses->Layout();
|
m_panelNetsAndClasses->Layout();
|
||||||
bSizer16->Fit( m_panelNetsAndClasses );
|
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 );
|
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 );
|
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 = new wxChoice( presetsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbLayerPresetsNChoices, m_cbLayerPresetsChoices, 0 );
|
||||||
m_cbLayerPresets->SetSelection( 1 );
|
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 = new wxBitmapButton( presetsSizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||||
m_btnDeletePreset->Enable( false );
|
m_btnDeletePreset->Enable( false );
|
||||||
m_btnDeletePreset->SetToolTip( wxT("Delete this layer preset") );
|
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 );
|
m_sizerOuter->Add( presetsSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
<object class="notebookpage" expanded="1">
|
<object class="notebookpage" expanded="1">
|
||||||
<property name="bitmap"></property>
|
<property name="bitmap"></property>
|
||||||
<property name="label">Layers</property>
|
<property name="label">Layers</property>
|
||||||
<property name="select">1</property>
|
<property name="select">0</property>
|
||||||
<object class="wxPanel" expanded="1">
|
<object class="wxPanel" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND|wxTOP</property>
|
<property name="flag">wxEXPAND</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxScrolledWindow" expanded="1">
|
<object class="wxScrolledWindow" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
@ -239,7 +239,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxBOTTOM|wxEXPAND|wxTOP</property>
|
<property name="flag">wxEXPAND|wxTOP</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxCollapsiblePane" expanded="1">
|
<object class="wxCollapsiblePane" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
@ -821,7 +821,7 @@
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">2</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND|wxALL</property>
|
<property name="flag">wxEXPAND|wxALL</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxGridBagSizer" expanded="0">
|
<object class="wxGridBagSizer" expanded="0">
|
||||||
|
@ -829,7 +829,7 @@
|
||||||
<property name="flexible_direction">wxBOTH</property>
|
<property name="flexible_direction">wxBOTH</property>
|
||||||
<property name="growablecols"></property>
|
<property name="growablecols"></property>
|
||||||
<property name="growablerows"></property>
|
<property name="growablerows"></property>
|
||||||
<property name="hgap">0</property>
|
<property name="hgap">4</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">m_objectsSizer</property>
|
<property name="name">m_objectsSizer</property>
|
||||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||||
|
@ -846,7 +846,7 @@
|
||||||
<object class="notebookpage" expanded="1">
|
<object class="notebookpage" expanded="1">
|
||||||
<property name="bitmap"></property>
|
<property name="bitmap"></property>
|
||||||
<property name="label">Nets</property>
|
<property name="label">Nets</property>
|
||||||
<property name="select">0</property>
|
<property name="select">1</property>
|
||||||
<object class="wxPanel" expanded="1">
|
<object class="wxPanel" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
|
@ -1922,7 +1922,7 @@
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxChoice" expanded="1">
|
<object class="wxChoice" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
@ -1987,7 +1987,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxBitmapButton" expanded="1">
|
<object class="wxBitmapButton" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
|
Loading…
Reference in New Issue