UI: Draw RadioButton with the I_RADIO_* atlas images

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-11-05 18:23:42 +01:00
1 parent 94a65a1ff7
commit 70e0782da8
2 files changed
+3 -9

No files matched your search

+2 -8
View File
@@ -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);
+1 -1
View File
@@ -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 {