Bug 531078 - Use MacOS system color for selected text background in inactive windows. r=mstange.

This commit is contained in:
stefanh@inbox.com 2016-11-15 20:38:22 +01:00
parent 0a1aa00f54
commit 4d7b2dacaf
2 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,11 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
case eColorID_TextSelectBackground:
aColor = GetColorFromNSColor([NSColor selectedTextBackgroundColor]);
break;
// This is used to gray out the selection when it's not focused. Used with
// nsISelectionController::SELECTION_DISABLED.
case eColorID_TextSelectBackgroundDisabled:
aColor = GetColorFromNSColor([NSColor secondarySelectedControlColor]);
break;
case eColorID_highlight: // CSS2 color
aColor = GetColorFromNSColor([NSColor alternateSelectedControlColor]);
break;

View File

@ -769,12 +769,14 @@ nsXPLookAndFeel::GetColorImpl(ColorID aID, bool aUseStandinsForNativeColors,
}
// There are no system color settings for these, so set them manually
#ifndef XP_MACOSX
if (aID == eColorID_TextSelectBackgroundDisabled) {
// This is used to gray out the selection when it's not focused
// Used with nsISelectionController::SELECTION_DISABLED
aResult = NS_RGB(0xb0, 0xb0, 0xb0);
return NS_OK;
}
#endif
if (aID == eColorID_TextSelectBackgroundAttention) {
if (sFindbarModalHighlight) {