Cvpcb: fix incorrect display of a bold text inside the main toolbar.

This commit is contained in:
jean-pierre charras 2020-02-20 12:48:23 +01:00
parent e59a3d981e
commit 59517ac24d
1 changed files with 9 additions and 2 deletions

View File

@ -61,10 +61,17 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
// Add tools for footprint names filtering: // Add tools for footprint names filtering:
KiScaledSeparator( m_mainToolBar, this ); 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 ); m_mainToolBar->AddSpacer( 15 );
wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY, wxString msg_bold = _( "Footprint Filters:" );
_( "Footprint Filters:" ) ); wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY, msg_bold );
text->SetFont( m_mainToolBar->GetFont().Bold() ); text->SetFont( m_mainToolBar->GetFont().Bold() );
#ifdef __WXGTK3__
text->SetLabelMarkup( "<b>" + msg_bold + "</b>" );
#endif
m_mainToolBar->AddControl( text ); m_mainToolBar->AddControl( text );
m_mainToolBar->Add( CVPCB_ACTIONS::FilterFPbyFPFilters, true ); m_mainToolBar->Add( CVPCB_ACTIONS::FilterFPbyFPFilters, true );