diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 81ae2951bc..66dc704db8 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -145,6 +145,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame }; SetStatusWidths( arrayDim( dims ), dims ); + stsbar->SetFont( KIUI::GetInfoFont() ); // Create child subwindows. GetClientSize( &m_frameSize.x, &m_frameSize.y ); diff --git a/common/widgets/msgpanel.cpp b/common/widgets/msgpanel.cpp index 3da1e9db84..761809c8ec 100644 --- a/common/widgets/msgpanel.cpp +++ b/common/widgets/msgpanel.cpp @@ -35,6 +35,8 @@ #include #include +#include + BEGIN_EVENT_TABLE( EDA_MSG_PANEL, wxPanel ) EVT_PAINT( EDA_MSG_PANEL::OnPaint ) @@ -54,7 +56,8 @@ EDA_MSG_PANEL::EDA_MSG_PANEL( wxWindow* aParent, int aId, m_last_x = 0; - m_fontSize = computeFontSize(); + SetFont( KIUI::GetInfoFont() ); + m_fontSize = GetTextExtent( wxT( "W" ) ); } @@ -63,24 +66,16 @@ EDA_MSG_PANEL::~EDA_MSG_PANEL() } -wxSize EDA_MSG_PANEL::computeFontSize() +int EDA_MSG_PANEL::GetRequiredHeight() { - // Get size of the wxSYS_DEFAULT_GUI_FONT wxSize fontSizeInPixels; - wxScreenDC dc; dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) ); dc.GetTextExtent( wxT( "W" ), &fontSizeInPixels.x, &fontSizeInPixels.y ); - return fontSizeInPixels; -} - - -int EDA_MSG_PANEL::GetRequiredHeight() -{ // make space for two rows of text plus a number of pixels between them. - return 2 * computeFontSize().y + 0; + return 2 * fontSizeInPixels.y + 0; } diff --git a/include/widgets/msgpanel.h b/include/widgets/msgpanel.h index fb42318f52..eb286bdabc 100644 --- a/include/widgets/msgpanel.h +++ b/include/widgets/msgpanel.h @@ -161,11 +161,6 @@ protected: void erase( wxDC* DC ); - /** - * Compute the height and width of a 'W' in the system font. - */ - static wxSize computeFontSize(); - /** * Calculate the width and height of a text string using the system UI font. */