From 23c386bd1c0f266aed2d5428506780ffbfaca733 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Thu, 27 Nov 2008 23:30:12 +0100 Subject: [PATCH] Bug 465348 - GrayText color is too dark on 10.5. r=josh, sr=roc, a191=beltzner --- widget/src/cocoa/nsLookAndFeel.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/widget/src/cocoa/nsLookAndFeel.mm b/widget/src/cocoa/nsLookAndFeel.mm index 688f3c26d14..f6bfbece46e 100644 --- a/widget/src/cocoa/nsLookAndFeel.mm +++ b/widget/src/cocoa/nsLookAndFeel.mm @@ -53,6 +53,14 @@ nsLookAndFeel::~nsLookAndFeel() { } +static nscolor GetColorFromNSColor(NSColor* aColor) +{ + NSColor* deviceColor = [aColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; + return NS_RGB((unsigned int)([deviceColor redComponent] * 255.0), + (unsigned int)([deviceColor greenComponent] * 255.0), + (unsigned int)([deviceColor blueComponent] * 255.0)); +} + nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) { nsresult res = NS_OK; @@ -209,7 +217,7 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) res = GetMacBrushColor(kThemeBrushButtonActiveDarkShadow, aColor, NS_RGB(0x77,0x77,0x77)); break; case eColor_graytext: - res = GetMacTextColor(kThemeTextColorDialogInactive, aColor, NS_RGB(0x77,0x77,0x77)); + aColor = GetColorFromNSColor([NSColor disabledControlTextColor]); break; case eColor_inactiveborder: //ScrollBar DelimiterInactive looks like an odd constant to use, but gives the right colour in most themes,