Bug 1743600 - Use controlBackgroundColor for ButtonFace if controlColor is transparent. r=harry

This is useful because it might be worth it to invert ButtonFace and ButtonText
to provide highlighted appearance or so. See the discussion in D130641.

Depends on D132478

Differential Revision: https://phabricator.services.mozilla.com/D132479
This commit is contained in:
Emilio Cobos Álvarez 2021-12-08 10:40:26 +00:00
parent a82d50ed53
commit 6c7be5c0ae

View File

@ -205,6 +205,9 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor
case ColorID::MozButtonactiveface:
case ColorID::MozButtondisabledface:
color = GetColorFromNSColor(NSColor.controlColor);
if (!NS_GET_A(color)) {
color = GetColorFromNSColor(NSColor.controlBackgroundColor);
}
break;
case ColorID::Buttonhighlight:
color = GetColorFromNSColor(NSColor.selectedControlColor);