Bug 1675389 - Tweak the baseline of checkbox/radio buttons on the non-native theme. r=spohl

Differential Revision: https://phabricator.services.mozilla.com/D102478
This commit is contained in:
Emilio Cobos Álvarez 2021-01-20 20:08:35 +00:00
Родитель b06a920288
Коммит ac01ad2d5e
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -1332,6 +1332,11 @@ LayoutDeviceIntMargin nsNativeBasicTheme::GetWidgetBorder(
LayoutDeviceIntCoord w = (kButtonBorderWidth * dpiRatio).Rounded();
return LayoutDeviceIntMargin(w, w, w, w);
}
case StyleAppearance::Checkbox:
case StyleAppearance::Radio: {
LayoutDeviceIntCoord w = (kCheckboxRadioBorderWidth * dpiRatio).Rounded();
return LayoutDeviceIntMargin(w, w, w, w);
}
default:
return LayoutDeviceIntMargin();
}

Просмотреть файл

@ -117,6 +117,10 @@ static const CSSCoord kRangeHeight = 6.0f;
static const CSSCoord kProgressbarHeight = 6.0f;
static const CSSCoord kMeterHeight = 12.0f;
// nsCheckboxRadioFrame takes the bottom of the content box as the baseline.
// This border-width makes its baseline 2px under the bottom, which is nice.
static const CSSCoord kCheckboxRadioBorderWidth = 2.0f;
} // namespace widget
} // namespace mozilla