Bug 1941755 - Tweak checked radio rendering as per UX feedback. r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D234341
This commit is contained in:
Emilio Cobos Álvarez
2025-01-17 09:05:19 +00:00
parent c8048340be
commit c98d401fa6

View File

@@ -652,14 +652,13 @@ void Theme::PaintRadioControl(PaintBackendData& aPaintData,
} }
if (aState.HasState(ElementState::CHECKED)) { if (aState.HasState(ElementState::CHECKED)) {
const CSSCoord kInnerBorderWidth = 2.0f;
LayoutDeviceRect rect(aRect); LayoutDeviceRect rect(aRect);
auto width = LayoutDeviceCoord( // Make the inner white dot take ~half of the checkbox (snapped to device
ThemeDrawing::SnapBorderWidth(kInnerBorderWidth, aDpiRatio)); // pixels).
rect.Deflate(width); rect.Deflate(std::max(LayoutDeviceIntCoord(1),
(LayoutDeviceCoord(rect.width) * 0.25f).Truncated()));
PaintStrokedCircle(aPaintData, rect, backgroundColor, checkColor, PaintStrokedCircle(aPaintData, rect, checkColor, sTransparent, 0,
kInnerBorderWidth, aDpiRatio); aDpiRatio);
} }
if (aState.HasState(ElementState::FOCUSRING)) { if (aState.HasState(ElementState::FOCUSRING)) {