mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 1698336 - Fix high contrast rendering of <meter>. r=mstange
Using the same color for the track and the meter chunk is not going to fly of course... In high contrast, make the colors consistent with <progress>, which seems like a reasonable thing to do. Differential Revision: https://phabricator.services.mozilla.com/D108347
This commit is contained in:
parent
5e0e37888a
commit
f717a6f4db
@ -459,8 +459,7 @@ std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeProgressTrackColors(
|
||||
std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeMeterchunkColors(
|
||||
const EventStates& aMeterState, UseSystemColors aUseSystemColors) {
|
||||
if (bool(aUseSystemColors)) {
|
||||
return SystemColorPair(StyleSystemColor::TextBackground,
|
||||
StyleSystemColor::TextForeground);
|
||||
return ComputeProgressColors(aUseSystemColors);
|
||||
}
|
||||
sRGBColor borderColor = sColorMeterGreen20;
|
||||
sRGBColor chunkColor = sColorMeterGreen10;
|
||||
@ -476,15 +475,6 @@ std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeMeterchunkColors(
|
||||
return std::make_pair(chunkColor, borderColor);
|
||||
}
|
||||
|
||||
std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeMeterTrackColors(
|
||||
UseSystemColors aUseSystemColors) {
|
||||
if (bool(aUseSystemColors)) {
|
||||
return SystemColorPair(StyleSystemColor::TextBackground,
|
||||
StyleSystemColor::TextForeground);
|
||||
}
|
||||
return std::make_pair(sColorGrey10, sColorGrey40);
|
||||
}
|
||||
|
||||
sRGBColor nsNativeBasicTheme::ComputeMenulistArrowButtonColor(
|
||||
const EventStates& aState, UseSystemColors aUseSystemColors) {
|
||||
bool isDisabled = aState.HasState(NS_EVENT_STATE_DISABLED);
|
||||
@ -1322,8 +1312,7 @@ void nsNativeBasicTheme::PaintProgress(nsIFrame* aFrame,
|
||||
{
|
||||
// Paint the track, unclipped.
|
||||
auto [backgroundColor, borderColor] =
|
||||
aIsMeter ? ComputeMeterTrackColors(aUseSystemColors)
|
||||
: ComputeProgressTrackColors(aUseSystemColors);
|
||||
ComputeProgressTrackColors(aUseSystemColors);
|
||||
PaintRoundedRectWithRadius(aPaintData, rect, rect, backgroundColor,
|
||||
borderColor, borderWidth, radius, aDpiRatio);
|
||||
}
|
||||
|
@ -207,7 +207,6 @@ class nsNativeBasicTheme : protected nsNativeTheme, public nsITheme {
|
||||
std::pair<sRGBColor, sRGBColor> ComputeProgressTrackColors(UseSystemColors);
|
||||
std::pair<sRGBColor, sRGBColor> ComputeMeterchunkColors(
|
||||
const EventStates& aMeterState, UseSystemColors);
|
||||
std::pair<sRGBColor, sRGBColor> ComputeMeterTrackColors(UseSystemColors);
|
||||
sRGBColor ComputeMenulistArrowButtonColor(const EventStates&,
|
||||
UseSystemColors);
|
||||
std::array<sRGBColor, 3> ComputeFocusRectColors(UseSystemColors);
|
||||
|
Loading…
Reference in New Issue
Block a user