From dacb5f58e8a7a76fbb464aed2ca9f0f3219367a1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 1 Jul 2021 15:40:06 +0100 Subject: [PATCH] Default bus entries to default (0 width and transparent color). Also adds some help text to the dialog so it's easier to figure out what's going on. Fixes https://gitlab.com/kicad/code/kicad/issues/8607 --- eeschema/dialogs/dialog_edit_line_style.cpp | 3 + .../dialogs/dialog_edit_line_style_base.cpp | 12 +- .../dialogs/dialog_edit_line_style_base.fbp | 126 +++++++++++++++++- .../dialogs/dialog_edit_line_style_base.h | 2 + eeschema/sch_bus_entry.cpp | 4 + 5 files changed, 143 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_line_style.cpp b/eeschema/dialogs/dialog_edit_line_style.cpp index 1ece588c75..d75058ff7f 100644 --- a/eeschema/dialogs/dialog_edit_line_style.cpp +++ b/eeschema/dialogs/dialog_edit_line_style.cpp @@ -64,6 +64,9 @@ DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE( SCH_EDIT_FRAME* aParent, m_colorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED ); + m_helpLabel1->SetFont( KIUI::GetInfoFont() ); + m_helpLabel2->SetFont( KIUI::GetInfoFont() ); + SetInitialFocus( m_lineWidth ); for( auto& typeEntry : lineTypeNames ) diff --git a/eeschema/dialogs/dialog_edit_line_style_base.cpp b/eeschema/dialogs/dialog_edit_line_style_base.cpp index 0282c02a73..b9f063970b 100644 --- a/eeschema/dialogs/dialog_edit_line_style_base.cpp +++ b/eeschema/dialogs/dialog_edit_line_style_base.cpp @@ -39,7 +39,7 @@ DIALOG_EDIT_LINE_STYLE_BASE::DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWi m_staticWidthUnits->Wrap( -1 ); m_staticWidthUnits->SetMinSize( wxSize( 40,-1 ) ); - fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 3 ); + fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 3 ); m_staticTextColor = new wxStaticText( this, wxID_ANY, _("Color:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextColor->Wrap( -1 ); @@ -71,7 +71,15 @@ DIALOG_EDIT_LINE_STYLE_BASE::DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWi fgSizerGeneral->Add( m_typeCombo, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 3 ); - mainSizer->Add( fgSizerGeneral, 1, wxEXPAND|wxALL, 10 ); + mainSizer->Add( fgSizerGeneral, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_helpLabel1 = new wxStaticText( this, wxID_ANY, _("Set width to 0 to use Schematic Editor line widths."), wxDefaultPosition, wxDefaultSize, 0 ); + m_helpLabel1->Wrap( 333 ); + mainSizer->Add( m_helpLabel1, 0, wxRIGHT|wxLEFT, 10 ); + + m_helpLabel2 = new wxStaticText( this, wxID_ANY, _("Set color to transparent to use Schematic Editor colors."), wxDefaultPosition, wxDefaultSize, 0 ); + m_helpLabel2->Wrap( -1 ); + mainSizer->Add( m_helpLabel2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 10 ); m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); mainSizer->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); diff --git a/eeschema/dialogs/dialog_edit_line_style_base.fbp b/eeschema/dialogs/dialog_edit_line_style_base.fbp index 6b842f69f4..f2196b6e41 100644 --- a/eeschema/dialogs/dialog_edit_line_style_base.fbp +++ b/eeschema/dialogs/dialog_edit_line_style_base.fbp @@ -60,7 +60,7 @@ none 10 - wxEXPAND|wxALL + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 1 3 @@ -201,7 +201,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -584,6 +584,128 @@ + + 10 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Set width to 0 to use Schematic Editor line widths. + 0 + + 0 + + + 0 + + 1 + m_helpLabel1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + 333 + + + + 10 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Set color to transparent to use Schematic Editor colors. + 0 + + 0 + + + 0 + + 1 + m_helpLabel2 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT diff --git a/eeschema/dialogs/dialog_edit_line_style_base.h b/eeschema/dialogs/dialog_edit_line_style_base.h index 16f24e0652..43b5a93fc2 100644 --- a/eeschema/dialogs/dialog_edit_line_style_base.h +++ b/eeschema/dialogs/dialog_edit_line_style_base.h @@ -50,6 +50,8 @@ class DIALOG_EDIT_LINE_STYLE_BASE : public DIALOG_SHIM COLOR_SWATCH* m_colorSwatch; wxStaticText* m_staticTextStyle; wxBitmapComboBox* m_typeCombo; + wxStaticText* m_helpLabel1; + wxStaticText* m_helpLabel2; wxStaticLine* m_staticline; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index e325a49c9b..fa35f265ee 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -45,6 +45,10 @@ SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, bool m_size.x = Mils2iu( DEFAULT_SCH_ENTRY_SIZE ); m_size.y = Mils2iu( DEFAULT_SCH_ENTRY_SIZE ); + m_stroke.SetWidth( 0 ); + m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetColor( COLOR4D::UNSPECIFIED ); + if( aFlipY ) m_size.y *= -1;