From fcda2beabba51269d6ef82f7a74c7532d2be3118 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 3 Nov 2019 18:10:16 +0100 Subject: [PATCH] Let standard buttons on wxMSW have at least the height of wxBU_EXACTFIT Closes #18563 --- src/msw/anybutton.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index 7fc9ab5a40..d3ea3d3ee7 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -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, - // so make them as high as it. - int yText; - wxGetCharSize(GetHwndOf(btn), NULL, &yText, btn->GetFont()); - yText = wxGetEditHeightFromCharHeight(yText, btn); - sizeBtn.IncTo(wxSize(-1, yText)); - } + // 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);