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)) {
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)) {