From 59517ac24dc7f8987affbcc648ae8002b9cc74b7 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 20 Feb 2020 12:48:23 +0100 Subject: [PATCH] Cvpcb: fix incorrect display of a bold text inside the main toolbar. --- cvpcb/toolbars_cvpcb.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cvpcb/toolbars_cvpcb.cpp b/cvpcb/toolbars_cvpcb.cpp index 870a4a2339..5bfd2a4f9f 100644 --- a/cvpcb/toolbars_cvpcb.cpp +++ b/cvpcb/toolbars_cvpcb.cpp @@ -61,10 +61,17 @@ void CVPCB_MAINFRAME::ReCreateHToolbar() // Add tools for footprint names filtering: KiScaledSeparator( m_mainToolBar, this ); + + // wxGTK with GTK3 has a serious issue with bold texts: strings are incorrectly sized + // and truncated after the first space. + // so use SetLabelMarkup is a trick to fix this issue. m_mainToolBar->AddSpacer( 15 ); - wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY, - _( "Footprint Filters:" ) ); + wxString msg_bold = _( "Footprint Filters:" ); + wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY, msg_bold ); text->SetFont( m_mainToolBar->GetFont().Bold() ); +#ifdef __WXGTK3__ + text->SetLabelMarkup( "" + msg_bold + "" ); +#endif m_mainToolBar->AddControl( text ); m_mainToolBar->Add( CVPCB_ACTIONS::FilterFPbyFPFilters, true );