31

In my Eclipse installation, the selected entry in the content assist menu is almost unreadable because the colour is white on white-greyish. See image below.

Highlighted entry unreadable

I can change the background and text colour of the non-selected entries in the list from eclipse preferences, but the selected entry is always the same colour and is always unreadable. I use the Eclipse Color Theme RecognEyes, but that should only affect the editor as far as I understand.

How do I make the text of the selected entry in the context assist menu readable?

Update

After reading m1shk4's answer it does indeed seem that Eclipse takes it's colours from the current gnome theme. However it does this in a kind of weird way.

The background colour of the content assist "window" is the input boxes background colour, and the text colour is the input boxes text colour. This all seems logical.

However the background colour of the selected entry is the windows background colour, but the text of the selected entry is not the background text colour.

See image below for an illustration.

Color mapping from gnome theme to eclipse

Does anybody know how to fix or workaround this issue?

Working workaround

It seems this issue is rather specific with the default gnome theme in Ubuntu. Switching to another gnome theme solves the issue for me.

Community
  • 1
  • 1
Bjarke Freund-Hansen
  • 28,728
  • 25
  • 92
  • 135
  • I had the exact same problem! What solved it for me, was changing the text color for "Selected Items" to black. This actually changed the highlighted text from white to black. – jottr Jul 16 '11 at 22:49
  • that's sad. There is no way to disable the "native" look and just chosse what colors I want to see in the content assist? – akappa Jul 21 '11 at 10:38
  • 2
    In case this helps anyone-- In Ubuntu 12.04, I had to install the GNOME Color Chooser application from the Ubuntu software center, then: In its Global Colors tab under Entry Fields, set "selected" to black and "Background" to light gray. In its Specific tab under Tooltips, set "Foreground" to black and "Background" to white. – Luke Jan 13 '13 at 04:53

7 Answers7

19

Not sure if it's still in time but this might help all of you who are having the same problem, as I had:

Create a file ~/.gtkrc-2.0 and add this content to the file:

style "eclipse_fix" 
{ 
base[ACTIVE] = shade(0.7, "#4283d3") 
}

class "GtkTreeView" style "eclipse_fix"

Then just set Unity a new theme (in Configuration > appearance) and set again to the previous theme (Ambiance for instance). That will read the new file created above and the new color will take effect in eclipse.

Marijn
  • 10,367
  • 5
  • 59
  • 80
14

I'm on Eclipse Neon and using Eclipse Color Themes.

I've solved this issue by:

Window-> Preferences-> General-> Appearance: 
->Uncheck "Use mixed fonts and colors for labels."
Přemysl Šťastný
  • 1,676
  • 2
  • 18
  • 39
ferreiradev
  • 327
  • 5
  • 16
  • This worked for me. I was reluctant to try it because it sounds like it turns off syntax based coloring, but that's not the case. You get nice black text on a light background on the highlighted content assist item with everything else remaining the same. Great answer! – Mathematician May 09 '21 at 14:19
8

Windows > Preference > General > Appearance > Color and Fonts

Basic > Content Assist background color, Content Assist foreground color:

Preference

and voilà!

Content Assist

Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
Mia
  • 89
  • 2
  • 7
    Hi Mia. I tried this, it changes the colours for the non-select items in the list just fine, but the selected entry does not change colours, and is still unreadable. :/ – Bjarke Freund-Hansen Jun 24 '11 at 07:43
5

Update screenshot

Interface is in Russian, but I think it's clear that colors, you're looking for, correspond to Selected Items entry. On my screenshot its light-blue for background and black for foreground.

Mykhailo Gaidai
  • 3,130
  • 1
  • 21
  • 23
  • 1
    I don't know how you see I am on Windows. I am in fact working on an Ubuntu machine, however are you saying that the selected entry gets it colours from the system settings? – Bjarke Freund-Hansen Jun 27 '11 at 09:56
  • 1
    Bad guess on OS :( Font looks similar to Windows one. On the problem - yes, system settings(`System -> Settings -> Appearance -> Customize -> Colors tab` should do the trick – Mykhailo Gaidai Jun 27 '11 at 22:55
  • Thanks, it seems to change the colours, but the mapping is not logical I believe, and it does not solve my problem. See my update to the question. – Bjarke Freund-Hansen Jun 28 '11 at 07:57
  • I've updated the answer with the screenshot. Please take a look – Mykhailo Gaidai Jun 28 '11 at 13:02
  • It does indeed seem your window and input boxes colours matches correctly. And it also seems we use almost the same colours. Can I ask, which distribution and version of Linux (I assume) are you running? Also which Gnome theme are you using? Thanks. – Bjarke Freund-Hansen Jun 28 '11 at 13:44
  • Ubuntu 11.04, Classic(no Unity), Theme is based on [Human-Pro](http://gnome-look.org/content/show.php/Human-Pro?content=136126). – Mykhailo Gaidai Jun 28 '11 at 20:11
  • Okay, it does indeed seem to be based on the current theme. I still cannot understand how the colours works, or why the text of the selected entry is white instead of black. However, downloading and using the Human-pro theme solves the issue for me, and I am reluctant to spend any more time on this. Thanks a lot for your help. – Bjarke Freund-Hansen Jun 29 '11 at 06:15
  • 1
    Yeah, same problem here on Ubuntu Natty, had to Customize Theme, and change "Selected item", "Text" value to a slightly darker grey. Not perfect, but not I can at least work. Also, I'm using a rather bad laptop screen, which doesn't help. – Jaco van Niekerk Jul 06 '11 at 19:53
5

If you are on Ubuntu / Unity, go ahead and install and start gnome-color-chooser. Global Colors -> Default Configuration, Entry Fields -> selected and change fg and bg colors according to your needs.

Adrian Muraru
  • 351
  • 4
  • 9
  • 1
    I did this /and/ changed the colors for the content assist window to be white background and black foreground. Using gnome-color-choose to set it to a greyish color makes it close enough to at least be readable. – Mike Miller Mar 05 '12 at 21:29
0

I have the same issue on Windows 7. I found that text color(unselected text) of the content assist box can be changed under: Desktop->Personalize->Window Color->Advanced Appearance Settings->Item->MessageBox

The only problem is one cannot set the background color for the MessageBox. -> any help from someone else?

At least this way you can read something...

NOTE: Be warned that a lot of other applications may depend on the messageBox color!

Andrei
  • 2,282
  • 26
  • 35
0

I was able to fix this in Ubuntu 12.04 by editing a file in the theme (I use Radiance):

sudo vi /usr/share/themes/Radiance/gtk-2.0/gtkrc

At the top is a key "gtk-color-scheme" with a bunch of color variables that are used later in the file. I make these changes: tooltip_fg_color:#000000 selected_fg_color:#000000 tooltip_bg_color:#f5f5b5

After making the changes, change your theme to something else then back, and most everything looks better! I did have to restart eclipse to get the fonts in the borders of the window to update.

Note that unfortunately these changes get overwritten sometimes during updates. There may be a way to use ~/.gtkrc-2.0 to do the same thing, I just don't know anything about that file.

8forty
  • 545
  • 4
  • 13