From 3dde4e56163d55729f3fda45652f8e4170abe792 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 31 Oct 2020 08:36:32 -0400 Subject: [PATCH] Eeschema: fix yet another symbol properties dialog layout issue. Stop trying to make a read only wxTextCtrl with a custom font work for displaying the symbol library identifier and use an ellipsized wxStaticText control with the standard font instead. Fixes https://gitlab.com/kicad/code/kicad/-/issues/6240 --- eeschema/dialogs/dialog_symbol_properties.cpp | 9 +------- .../dialogs/dialog_symbol_properties_base.cpp | 8 +++---- .../dialogs/dialog_symbol_properties_base.fbp | 21 ++++++++----------- .../dialogs/dialog_symbol_properties_base.h | 3 +-- 4 files changed, 14 insertions(+), 27 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index a20def3087..7806dce826 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -343,13 +343,6 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent, m_pinGrid->PushEventHandler( new GRID_TRICKS( m_pinGrid ) ); - // Set font size for items showing long strings: - wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); - infoFont.SetSymbolicSize( wxFONTSIZE_SMALL ); - - m_libraryIDLabel->SetFont( infoFont ); - m_tcLibraryID->SetFont( infoFont ); - wxToolTip::Enable( true ); m_stdDialogButtonSizerOK->SetDefault(); @@ -494,7 +487,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow() m_ShowPinNameButt->SetValue( m_part->ShowPinNames() ); // Set the component's library name. - m_tcLibraryID->SetValue( m_comp->GetLibId().Format() ); + m_tcLibraryID->SetLabelText( m_comp->GetLibId().Format() ); Layout(); diff --git a/eeschema/dialogs/dialog_symbol_properties_base.cpp b/eeschema/dialogs/dialog_symbol_properties_base.cpp index 2eb16cbcc6..8ac0621d7d 100644 --- a/eeschema/dialogs/dialog_symbol_properties_base.cpp +++ b/eeschema/dialogs/dialog_symbol_properties_base.cpp @@ -302,11 +302,9 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, m_libraryIDLabel->Wrap( -1 ); bLibLink->Add( m_libraryIDLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - m_tcLibraryID = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxBORDER_NONE ); - m_tcLibraryID->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - m_tcLibraryID->SetToolTip( _("The library ID and footprint ID currently assigned. Use \"Change Footprint...\" to assign a different footprint.") ); - - bLibLink->Add( m_tcLibraryID, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + m_tcLibraryID = new wxStaticText( this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END ); + m_tcLibraryID->Wrap( -1 ); + bLibLink->Add( m_tcLibraryID, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); bSizerBottom->Add( bLibLink, 1, wxEXPAND|wxLEFT, 10 ); diff --git a/eeschema/dialogs/dialog_symbol_properties_base.fbp b/eeschema/dialogs/dialog_symbol_properties_base.fbp index 03f488efd5..aa70cfbae0 100644 --- a/eeschema/dialogs/dialog_symbol_properties_base.fbp +++ b/eeschema/dialogs/dialog_symbol_properties_base.fbp @@ -1973,9 +1973,9 @@ 5 - wxEXPAND|wxLEFT|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 1 - + 1 1 1 @@ -1985,7 +1985,7 @@ - wxSYS_COLOUR_BTNFACE + 1 0 @@ -2003,10 +2003,11 @@ 0 0 wxID_ANY + MyLabel + 0 0 - 0 @@ -2021,18 +2022,14 @@ Resizable 1 - wxTE_READONLY + wxST_ELLIPSIZE_END ; ; forward_declare 0 - The library ID and footprint ID currently assigned. Use "Change Footprint..." to assign a different footprint. - - wxFILTER_NONE - wxDefaultValidator - - + - wxBORDER_NONE + + -1 diff --git a/eeschema/dialogs/dialog_symbol_properties_base.h b/eeschema/dialogs/dialog_symbol_properties_base.h index eb05d4fb6e..c39dede990 100644 --- a/eeschema/dialogs/dialog_symbol_properties_base.h +++ b/eeschema/dialogs/dialog_symbol_properties_base.h @@ -32,7 +32,6 @@ class WX_GRID; #include #include #include -#include #include /////////////////////////////////////////////////////////////////////////// @@ -71,7 +70,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM wxPanel* m_pinTablePage; WX_GRID* m_pinGrid; wxStaticText* m_libraryIDLabel; - wxTextCtrl* m_tcLibraryID; + wxStaticText* m_tcLibraryID; wxButton* m_spiceFieldsButton; wxStdDialogButtonSizer* m_stdDialogButtonSizer; wxButton* m_stdDialogButtonSizerOK;