From c98d401fa6fd7c7d18f0ce82ec257acd94e92f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 17 Jan 2025 09:05:19 +0000 Subject: [PATCH] Bug 1941755 - Tweak checked radio rendering as per UX feedback. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D234341 --- widget/Theme.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/widget/Theme.cpp b/widget/Theme.cpp index 6567c913a341..971551387b40 100644 --- a/widget/Theme.cpp +++ b/widget/Theme.cpp @@ -652,14 +652,13 @@ void Theme::PaintRadioControl(PaintBackendData& aPaintData, } if (aState.HasState(ElementState::CHECKED)) { - const CSSCoord kInnerBorderWidth = 2.0f; LayoutDeviceRect rect(aRect); - auto width = LayoutDeviceCoord( - ThemeDrawing::SnapBorderWidth(kInnerBorderWidth, aDpiRatio)); - rect.Deflate(width); - - PaintStrokedCircle(aPaintData, rect, backgroundColor, checkColor, - kInnerBorderWidth, aDpiRatio); + // Make the inner white dot take ~half of the checkbox (snapped to device + // pixels). + rect.Deflate(std::max(LayoutDeviceIntCoord(1), + (LayoutDeviceCoord(rect.width) * 0.25f).Truncated())); + PaintStrokedCircle(aPaintData, rect, checkColor, sTransparent, 0, + aDpiRatio); } if (aState.HasState(ElementState::FOCUSRING)) {