Fix wxStatusBar font and position after DPI changes

Update the font of the associated wxDC so ellipsization uses the correct font
size.
This commit is contained in:
Maarten Bent
2019-09-03 22:07:49 +02:00
parent 4713301cf5
commit e312569b94
3 changed files with 23 additions and 3 deletions

View File

@@ -166,7 +166,8 @@ bool wxStatusBar::SetFont(const wxFont& font)
if (!wxWindow::SetFont(font))
return false;
if (m_pDC) m_pDC->SetFont(font);
if ( m_pDC )
m_pDC->SetFont(m_font);
return true;
}
@@ -256,6 +257,14 @@ void wxStatusBar::MSWUpdateFieldsWidths()
delete [] pWidths;
}
void wxStatusBar::MSWUpdateFontOnDPIChange(const wxSize& newDPI)
{
wxStatusBarBase::MSWUpdateFontOnDPIChange(newDPI);
if ( m_pDC && m_font.IsOk() )
m_pDC->SetFont(m_font);
}
void wxStatusBar::DoUpdateStatusText(int nField)
{
if (!m_pDC)