Let standard buttons on wxMSW have at least the height of wxBU_EXACTFIT

Closes #18563
This commit is contained in:
Maarten Bent
2019-11-03 18:10:16 +01:00
parent 0e335b9dc1
commit fcda2beabb

View File

@@ -437,16 +437,16 @@ wxSize wxMSWButton::IncreaseToStdSizeAndCache(wxControl *btn, const wxSize& size
sizeBtn.IncTo(sizeDef);
}
else // wxBU_EXACTFIT case
{
// Such buttons are typically used alongside a text control or similar,
// wxBU_EXACTFIT is typically used alongside a text control or similar,
// so make them as high as it.
// The standard height is generally higher than this, but if not (e.g. when
// using a larger font) increase the button height as well.
int yText;
wxGetCharSize(GetHwndOf(btn), NULL, &yText, btn->GetFont());
yText = wxGetEditHeightFromCharHeight(yText, btn);
sizeBtn.IncTo(wxSize(-1, yText));
}
btn->CacheBestSize(sizeBtn);