From d756893c1c59e291faafa3f53411ad3733a44e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Nov 2026 18:48:11 +0100 Subject: [PATCH] UI: Give RadioButton the same padding and height as CheckBox Co-Authored-By: Claude Opus 5.5 --- Common/UI/View.cpp | 4 ++-- Common/UI/View.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index 637709a296..3861adc1ca 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -1075,9 +1075,9 @@ void RadioButton::GetContentDimensions(const UIContext &dc, float &w, float &h) dc.MeasureText(dc.GetTheme().uiFont, 1.0f, 1.0f, text_, &w, &h); } - // Add some internal padding to not look totally ugly + // Padding on both sides, and between the radio image and the text. Same height as a CheckBox. w += paddingW_ * 3.0f + radioRadius_ * 2.0f; - h = std::max(h, radioRadius_ * 2) + paddingH_ * 2; + h = std::max(std::max(h, radioRadius_ * 2), ITEM_HEIGHT); } std::string RadioButton::DescribeText() const { diff --git a/Common/UI/View.h b/Common/UI/View.h index d3322280aa..ee961d25ab 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -1011,8 +1011,8 @@ private: int *value_; int thisButtonValue_; std::string text_; - const float paddingW_ = 8; - const float paddingH_ = 4; + // Same as CheckBox. + const float paddingW_ = 12; // Half the size of the I_RADIO_* images. const float radioRadius_ = 16.0f;