Improved readability of font changes to wxRendererMSW::GetCheckBoxSize and no longer force the window to redraw.
This commit is contained in:
@@ -604,10 +604,13 @@ int wxRendererMSW::GetHeaderButtonHeight(wxWindow * win)
|
|||||||
|
|
||||||
wxON_BLOCK_EXIT1( ::DestroyWindow, hwndHeader );
|
wxON_BLOCK_EXIT1( ::DestroyWindow, hwndHeader );
|
||||||
|
|
||||||
// Must ensure the proper font is set or the wrong value will be returned
|
// Set the font, even if it's the default one, before measuring the window.
|
||||||
// At 200% scaling it was returning a height of 28 when it should have been 40
|
wxFont font;
|
||||||
WXHANDLE hFont = (win && win->GetFont().IsOk() ? win->GetFont() : wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)).GetResourceHandle();
|
if ( win )
|
||||||
::SendMessage(hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
|
font = win->GetFont();
|
||||||
|
if ( !font.IsOk() )
|
||||||
|
wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||||
|
::SendMessage(hwndHeader, WM_SETFONT, (WPARAM)GetHfontOf(font), 0);
|
||||||
|
|
||||||
// initialize the struct filled with the values by Header_Layout()
|
// initialize the struct filled with the values by Header_Layout()
|
||||||
RECT parentRect = { 0, 0, 100, 100 };
|
RECT parentRect = { 0, 0, 100, 100 };
|
||||||
|
Reference in New Issue
Block a user