Bug 1690954 - Draw the menulist arrow button using currentColor rather than a fixed color. r=jfkthame

As its background might not be themed.

Differential Revision: https://phabricator.services.mozilla.com/D115194
This commit is contained in:
Emilio Cobos Álvarez 2021-05-17 12:11:15 +00:00
parent 2077c29048
commit f2a6ce01df
2 changed files with 2 additions and 14 deletions

View File

@ -619,16 +619,6 @@ std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeMeterchunkColors(
return std::make_pair(chunkColor, borderColor);
}
sRGBColor nsNativeBasicTheme::ComputeMenulistArrowButtonColor(
const EventStates& aState, UseSystemColors aUseSystemColors) {
bool isDisabled = aState.HasState(NS_EVENT_STATE_DISABLED);
if (bool(aUseSystemColors)) {
return SystemColor(isDisabled ? StyleSystemColor::Graytext
: StyleSystemColor::TextForeground);
}
return isDisabled ? sColorGrey60Alpha50 : sColorGrey60;
}
std::array<sRGBColor, 3> nsNativeBasicTheme::ComputeFocusRectColors(
const AccentColor& aAccent, UseSystemColors aUseSystemColors) {
if (bool(aUseSystemColors)) {
@ -1356,8 +1346,8 @@ void nsNativeBasicTheme::PaintMenulistArrowButton(
const float kPolygonSize = kMinimumDropdownArrowButtonWidth;
sRGBColor arrowColor =
ComputeMenulistArrowButtonColor(aState, aUseSystemColors);
const auto arrowColor = sRGBColor::FromABGR(
nsLayoutUtils::GetColor(aFrame, &nsStyleText::mWebkitTextFillColor));
PaintArrow(aDrawTarget, aRect, kPolygonX, kPolygonY, kPolygonSize,
ArrayLength(kPolygonX), arrowColor);
}

View File

@ -212,8 +212,6 @@ class nsNativeBasicTheme : protected nsNativeTheme, public nsITheme {
std::pair<sRGBColor, sRGBColor> ComputeProgressTrackColors(UseSystemColors);
std::pair<sRGBColor, sRGBColor> ComputeMeterchunkColors(
const EventStates& aMeterState, UseSystemColors);
sRGBColor ComputeMenulistArrowButtonColor(const EventStates&,
UseSystemColors);
std::array<sRGBColor, 3> ComputeFocusRectColors(const AccentColor&,
UseSystemColors);