From 70e0782da8972af785710b3b7bf41fb4a4e78798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Nov 2026 18:23:42 +0100 Subject: [PATCH] UI: Draw RadioButton with the I_RADIO_* atlas images Co-Authored-By: Claude Opus 5.5 --- Common/UI/View.cpp | 10 ++-------- Common/UI/View.h | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index c1d81ad9bb..637709a296 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -1104,14 +1104,8 @@ void RadioButton::Draw(UIContext &dc) { const Bounds bounds = ContentBounds(); - dc.Flush(); - dc.BeginNoTex(); - dc.Draw()->Circle(bounds.x + paddingW_ + radioRadius_, bounds.centerY(), radioRadius_, 2.5f, 36, 0, style.fgColor, 1.0f); - if (checked) { - dc.Draw()->FillCircle(bounds.x + paddingW_ + radioRadius_, bounds.centerY(), radioInnerRadius_, 36, style.fgColor); - } - dc.Flush(); - dc.Begin(); + const ImageID image(checked ? "I_RADIO_SELECTED" : "I_RADIO_EMPTY"); + dc.Draw()->DrawImage(image, bounds.x + paddingW_ + radioRadius_, bounds.centerY(), 1.0f, style.fgColor, ALIGN_CENTER); float tw, th; dc.MeasureText(dc.GetTheme().uiFont, 1.0f, 1.0f, text_, &tw, &th); diff --git a/Common/UI/View.h b/Common/UI/View.h index 81a7afd601..d3322280aa 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -1014,8 +1014,8 @@ private: const float paddingW_ = 8; const float paddingH_ = 4; + // Half the size of the I_RADIO_* images. const float radioRadius_ = 16.0f; - const float radioInnerRadius_ = 8.0f; }; class CollapsibleHeader : public CheckBox {