This commit is contained in:
Jeff Young 2021-09-08 20:17:46 +01:00
parent 3b16c38756
commit e7debc495b
3 changed files with 7 additions and 16 deletions

View File

@ -145,6 +145,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
}; };
SetStatusWidths( arrayDim( dims ), dims ); SetStatusWidths( arrayDim( dims ), dims );
stsbar->SetFont( KIUI::GetInfoFont() );
// Create child subwindows. // Create child subwindows.
GetClientSize( &m_frameSize.x, &m_frameSize.y ); GetClientSize( &m_frameSize.x, &m_frameSize.y );

View File

@ -35,6 +35,8 @@
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/toplevel.h> #include <wx/toplevel.h>
#include <widgets/ui_common.h>
BEGIN_EVENT_TABLE( EDA_MSG_PANEL, wxPanel ) BEGIN_EVENT_TABLE( EDA_MSG_PANEL, wxPanel )
EVT_PAINT( EDA_MSG_PANEL::OnPaint ) 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_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; wxSize fontSizeInPixels;
wxScreenDC dc; wxScreenDC dc;
dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) ); dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) );
dc.GetTextExtent( wxT( "W" ), &fontSizeInPixels.x, &fontSizeInPixels.y ); 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. // make space for two rows of text plus a number of pixels between them.
return 2 * computeFontSize().y + 0; return 2 * fontSizeInPixels.y + 0;
} }

View File

@ -161,11 +161,6 @@ protected:
void erase( wxDC* DC ); 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. * Calculate the width and height of a text string using the system UI font.
*/ */