diff --git a/eeschema/dialogs/dialog_shape_properties.cpp b/eeschema/dialogs/dialog_shape_properties.cpp
index be49786a1d..0e5d419f1a 100644
--- a/eeschema/dialogs/dialog_shape_properties.cpp
+++ b/eeschema/dialogs/dialog_shape_properties.cpp
@@ -248,30 +248,30 @@ void DIALOG_SHAPE_PROPERTIES::onFillRadioButton( wxCommandEvent& event )
if( event.GetId() == NO_FILL )
{
m_rbFillNone->SetValue( true );
- m_fillColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
+ m_customColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
}
else if( event.GetId() == FILLED_SHAPE )
{
m_rbFillOutline->SetValue( true );
- COLOR4D color = m_shape->GetStroke().GetColor();
+ COLOR4D color = m_borderColorSwatch->GetSwatchColor();
- if( color == COLOR4D::UNSPECIFIED )
+ if( color == COLOR4D::UNSPECIFIED || !m_rbFillOutline->GetValue() )
color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE );
- m_fillColorSwatch->SetSwatchColor( color, false );
+ m_customColorSwatch->SetSwatchColor( color, false );
}
else if( event.GetId() == FILLED_WITH_BG_BODYCOLOR )
{
m_rbFillBackground->SetValue( true );
COLOR4D color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND );
- m_fillColorSwatch->SetSwatchColor( color, false );
+ m_customColorSwatch->SetSwatchColor( color, false );
}
else if( event.GetId() == FILLED_WITH_COLOR )
{
m_rbFillCustom->SetValue( true );
- m_fillColorSwatch->GetNewSwatchColor();
+ m_customColorSwatch->GetNewSwatchColor();
}
}
@@ -280,6 +280,19 @@ void DIALOG_SHAPE_PROPERTIES::onBorderSwatch( wxCommandEvent& aEvent )
{
if( m_rbFillOutline->GetValue() )
m_fillColorSwatch->SetSwatchColor( m_borderColorSwatch->GetSwatchColor(), false );
+
+ if( m_rbFillOutline->IsEnabled() && m_rbFillOutline->GetValue() )
+ {
+ COLOR4D color = COLOR4D::UNSPECIFIED;
+
+ if( m_rbFillOutline->GetValue() )
+ color = m_fillColorSwatch->GetSwatchColor();
+
+ if( color == COLOR4D::UNSPECIFIED )
+ color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE );
+
+ m_customColorSwatch->SetSwatchColor( color, false );
+ }
}
diff --git a/eeschema/dialogs/dialog_shape_properties_base.cpp b/eeschema/dialogs/dialog_shape_properties_base.cpp
index 916fdf5a6e..bae739dc84 100644
--- a/eeschema/dialogs/dialog_shape_properties_base.cpp
+++ b/eeschema/dialogs/dialog_shape_properties_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
+// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -16,9 +16,9 @@ BEGIN_EVENT_TABLE( DIALOG_SHAPE_PROPERTIES_BASE, DIALOG_SHIM )
EVT_CHECKBOX( wxID_ANY, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onBorderChecked )
EVT_CHECKBOX( wxID_ANY, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFillChecked )
EVT_RADIOBUTTON( NO_FILL, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFillRadioButton )
- EVT_RADIOBUTTON( FILLED_SHAPE, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFill )
- EVT_RADIOBUTTON( FILLED_WITH_BG_BODYCOLOR, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFill )
- EVT_RADIOBUTTON( FILLED_WITH_COLOR, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFill )
+ EVT_RADIOBUTTON( FILLED_SHAPE, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFillRadioButton )
+ EVT_RADIOBUTTON( FILLED_WITH_BG_BODYCOLOR, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFillRadioButton )
+ EVT_RADIOBUTTON( FILLED_WITH_COLOR, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_onFillRadioButton )
END_EVENT_TABLE()
DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
@@ -174,7 +174,7 @@ DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wx
m_rbFillCustom = new wxRadioButton( bSizerFill->GetStaticBox(), FILLED_WITH_COLOR, _("Fill with:"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_rbFillCustom, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
- m_customColorSwatch = new COLOR_SWATCH( bSizerFill->GetStaticBox(), FILLED_WITH_COLOR, wxDefaultPosition, wxDefaultSize, 0 );
+ m_customColorSwatch = new COLOR_SWATCH( bSizerFill->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_customColorSwatch, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
diff --git a/eeschema/dialogs/dialog_shape_properties_base.fbp b/eeschema/dialogs/dialog_shape_properties_base.fbp
index bd961893ec..8a2c9713e5 100644
--- a/eeschema/dialogs/dialog_shape_properties_base.fbp
+++ b/eeschema/dialogs/dialog_shape_properties_base.fbp
@@ -1527,7 +1527,7 @@
- onFill
+ onFillRadioButton