From f6f7b8c70f06194f90837dc27644d2c0bc84fc90 Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Fri, 28 May 1999 00:38:43 +0000 Subject: [PATCH] Fixed eColor_TextSelectXXXXX --- widget/src/mac/nsLookAndFeel.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/widget/src/mac/nsLookAndFeel.cpp b/widget/src/mac/nsLookAndFeel.cpp index b9062555c701..e16066e91025 100644 --- a/widget/src/mac/nsLookAndFeel.cpp +++ b/widget/src/mac/nsLookAndFeel.cpp @@ -72,10 +72,23 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor) aColor = NS_RGB(0x00,0x00,0x00); break; case eColor_TextSelectBackground: - aColor = NS_RGB(0x00,0x00,0x80); + GrafPtr thePort; + ::GetPort(&thePort); + if (thePort) + { + GrafVars** grafVars = (GrafVars**)((CGrafPtr)thePort)->grafVars; + RGBColor macColor = (*grafVars)->rgbHiliteColor; + aColor = NS_RGB(macColor.red>>8, macColor.green>>8, macColor.blue>>8); + } + else + aColor = NS_RGB(0x00,0x00,0x00); break; case eColor_TextSelectForeground: - aColor = NS_RGB(0xff,0xff,0xff); + GetColor(eColor_TextSelectBackground, aColor); + if (aColor == 0xffffff) + aColor = NS_RGB(0x00,0x00,0x00); + else + aColor = NS_RGB(0xff,0xff,0xff); break; default: aColor = NS_RGB(0xff,0xff,0xff);