Bug 1511878 - Start respecting the alpha channel for disabled control text color on macOS to accommodate the way this system color is declared by the OS on macOS 10.14+. r=mstange, a=RyanVM
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Mon, 14 Jan 2019 19:54:32 -0500
changeset 509491 92b23e3b94efeb8093e22cab16828efd5b1cc693
parent 509490 c10cd6aadb9656703e01212906b77d3232694f3b
child 509492 0205f0c7abb246a425a40a1af1cae0105c164f0f
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, RyanVM
bugs1511878
milestone65.0
Bug 1511878 - Start respecting the alpha channel for disabled control text color on macOS to accommodate the way this system color is declared by the OS on macOS 10.14+. r=mstange, a=RyanVM
widget/cocoa/nsLookAndFeel.mm
--- a/widget/cocoa/nsLookAndFeel.mm
+++ b/widget/cocoa/nsLookAndFeel.mm
@@ -775,17 +775,19 @@ nsLookAndFeel::EnsureInit()
     mHasColorButtonText = true;
   }
 
   mColorButtonHoverText = GetColorFromNSColor([NSColor controlTextColor]);
   mColorText = GetColorFromNSColor([NSColor textColor]);
   mColorWindowText = GetColorFromNSColor([NSColor windowFrameTextColor]);
   mColorActiveCaption = GetColorFromNSColor([NSColor gridColor]);
   mColorActiveBorder = GetColorFromNSColor([NSColor keyboardFocusIndicatorColor]);
-  mColorGrayText = GetColorFromNSColor([NSColor disabledControlTextColor]);
+  NSColor* disabledColor = [NSColor disabledControlTextColor];
+  mColorGrayText = GetColorFromNSColorWithAlpha(disabledColor,
+                                                [disabledColor alphaComponent]);
   mColorInactiveBorder = GetColorFromNSColor([NSColor controlBackgroundColor]);
   mColorInactiveCaption = GetColorFromNSColor([NSColor controlBackgroundColor]);
   mColorScrollbar = GetColorFromNSColor([NSColor scrollBarColor]);
   mColorThreeDHighlight = GetColorFromNSColor([NSColor highlightColor]);
   mColorMenu = GetColorFromNSColor([NSColor alternateSelectedControlTextColor]);
   mColorWindowFrame = GetColorFromNSColor([NSColor gridColor]);
   mColorFieldText = GetColorFromNSColor([NSColor controlTextColor]);
   mColorDialog = GetColorFromNSColor([NSColor controlHighlightColor]);