From b833b12931a9d221eefc3297a458e19340341cef Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 10 Dec 2017 18:23:20 +0100 Subject: [PATCH] Improve wxRadioBox height on wxMSW With larger fonts, there is an excessive gap between the box and the first (and last) radio button. Instead of using the dynamic character size, use the fixed size of the radio button to determine this height. --- src/msw/radiobox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 8658a483d4..7ed9d135ee 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -582,7 +582,8 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const // Add extra space under the label, if it exists. if (!wxControl::GetLabel().empty()) - height += cy1/2; + height += wxRendererNative::Get().GetCheckBoxSize( + reinterpret_cast(const_cast(this))).y / 2; // and also wide enough for its label int widthLabel; @@ -658,7 +659,8 @@ wxRadioBox::PositionAllButtons(int x, int y, int width, int WXUNUSED(height)) // Add extra space under the label, if it exists. if (!wxControl::GetLabel().empty()) - y_offset += cy1/2; + y_offset += wxRendererNative::Get().GetCheckBoxSize( + reinterpret_cast(this)).y / 2; int startX = x_offset; int startY = y_offset;