Bug 384458 - part 1: make the background color of the SELECTION_ATTENTION range fully transparent when modal highlighting is on. r=masayuki

This commit is contained in:
Mike de Boer 2016-06-08 19:54:05 +02:00
Родитель 8af3a21e3c
Коммит 5414d108b5
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -247,6 +247,7 @@ int32_t nsXPLookAndFeel::sCachedColorBits[COLOR_CACHE_SIZE] = {0};
bool nsXPLookAndFeel::sInitialized = false;
bool nsXPLookAndFeel::sUseNativeColors = true;
bool nsXPLookAndFeel::sUseStandinsForNativeColors = false;
bool nsXPLookAndFeel::sFindbarModalHighlight = false;
nsLookAndFeel* nsXPLookAndFeel::sInstance = nullptr;
bool nsXPLookAndFeel::sShutdown = false;
@ -465,6 +466,9 @@ nsXPLookAndFeel::Init()
Preferences::AddBoolVarCache(&sUseStandinsForNativeColors,
"ui.use_standins_for_native_colors",
sUseStandinsForNativeColors);
Preferences::AddBoolVarCache(&sFindbarModalHighlight,
"findbar.modalHighlight",
sFindbarModalHighlight);
if (XRE_IsContentProcess()) {
mozilla::dom::ContentChild* cc =
@ -773,6 +777,11 @@ nsXPLookAndFeel::GetColorImpl(ColorID aID, bool aUseStandinsForNativeColors,
}
if (aID == eColorID_TextSelectBackgroundAttention) {
if (sFindbarModalHighlight) {
aResult = NS_RGBA(0, 0, 0, 0);
return NS_OK;
}
// This makes the selection stand out when typeaheadfind is on
// Used with nsISelectionController::SELECTION_ATTENTION
aResult = NS_RGB(0x38, 0xd8, 0x78);

Просмотреть файл

@ -111,6 +111,7 @@ protected:
static int32_t sCachedColorBits[COLOR_CACHE_SIZE];
static bool sUseNativeColors;
static bool sUseStandinsForNativeColors;
static bool sFindbarModalHighlight;
static nsLookAndFeel* sInstance;
static bool sShutdown;