Bug 1743600 - Use selectedControlTextColor for native buttons on macOS. r=mac-reviewers,spohl

This is drive-by, but looks like the appropriate system colors rather than
hardcoding to white. I've tested this in monterrey but should do the right
thing in older macOS versions too.

Depends on D132477

Differential Revision: https://phabricator.services.mozilla.com/D132478
This commit is contained in:
Emilio Cobos Álvarez 2021-12-01 18:23:04 +00:00
parent 2abc89c41e
commit 0dfd12b34e

View File

@ -177,11 +177,7 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor
color = NS_RGB(0xFF, 0xFF, 0xFF);
break;
case ColorID::MozButtonactivetext:
// Pre-macOS 12, pressed buttons were filled with the highlight color and the text was white.
// Starting with macOS 12, pressed (non-default) buttons are filled with medium gray and the
// text color is the same as in the non-pressed state.
color = nsCocoaFeatures::OnMontereyOrLater() ? GetColorFromNSColor(NSColor.controlTextColor)
: NS_RGB(0xFF, 0xFF, 0xFF);
color = GetColorFromNSColor(NSColor.selectedControlTextColor);
break;
case ColorID::Captiontext:
case ColorID::Menutext: