? vcl/aqua/source/window/aqua_diff_color_highlighted_89_90.diff Index: vcl/aqua/source/window/salframe.cxx =================================================================== RCS file: /cvs/gsl/vcl/aqua/source/window/salframe.cxx,v retrieving revision 1.46.112.98 diff -u -r1.46.112.98 salframe.cxx --- vcl/aqua/source/window/salframe.cxx 31 May 2007 07:45:19 -0000 1.46.112.98 +++ vcl/aqua/source/window/salframe.cxx 31 May 2007 10:36:05 -0000 @@ -793,6 +793,44 @@ // ----------------------------------------------------------------------- +// we have to get Quartz color in preferences, and convert them into sal colors +static bool getHighlightColorFromPrefs( Color* pColor ) +{ + // get the key in ~/Library/Preferences/.GlobalPreferences.plist + CFStringRef aHighLightColor = ( (CFStringRef)CFPreferencesCopyAppValue( CFSTR("AppleHighlightColor" ), kCFPreferencesCurrentApplication ) ); + + if (aHighLightColor == NULL) // default, when never modified + return false; + + // create a CFArray containing all the values, as CFString + CFArrayRef aCFArray = CFStringCreateArrayBySeparatingStrings ( kCFAllocatorDefault, aHighLightColor, CFSTR(" ") ); + + // we no longer need aHighlightColor + CFRelease(aHighLightColor); + + // create an array of double, containing Quartz values + double aColorArray[3]; + + short i; + for (i=0; i<3 ; i++) + { + aColorArray[i] = CFStringGetDoubleValue ( (CFStringRef)CFArrayGetValueAtIndex(aCFArray, i) ); + } + + AquaLog( ">*>_> %s R %f V %f B %f \n",__func__, aColorArray[0],aColorArray[1],aColorArray[2]); + + // we no longer need The CFArray + CFRelease(aCFArray); + + // the colors (uff) + pColor->SetRed( static_cast( aColorArray[0]*255) ); + pColor->SetGreen( static_cast( aColorArray[1]*255) ); + pColor->SetBlue( static_cast( aColorArray[2]*255) ); + + return true; +} + + static bool GetSystemFontSetting( ThemeFontID eThemeFontID, Font* pFont ) { // TODO: also allow non-roman font names @@ -846,9 +884,13 @@ aStyleSettings.SetLightBorderColor( aBackgroundColor ); // Selected Background Color - Color aSelectBackgroundColor = Color( 0x34, 0x70, 0xCC ); - aStyleSettings.SetHighlightColor( aSelectBackgroundColor ); - + + Color aSelectBackgroundColor; + if (getHighlightColorFromPrefs( &aSelectBackgroundColor ) ) + aStyleSettings.SetHighlightColor( aSelectBackgroundColor ); + else + aStyleSettings.SetHighlightColor( Color( 0x34, 0x70, 0xCC ) ); + // get the system font settings Font aFont = aStyleSettings.GetAppFont(); if( GetSystemFontSetting( kThemeApplicationFont, &aFont ) )