The selected entry in Eclipse content assist is un

2019-01-13 15:03发布

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.

7条回答
男人必须洒脱
2楼-- · 2019-01-13 15:42

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.

查看更多
forever°为你锁心
3楼-- · 2019-01-13 15:47

Windows > Preference > General > Appearance > Color and Fonts

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

Preference

and voilà!

Content Assist

查看更多
Ridiculous、
4楼-- · 2019-01-13 15:49

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.

查看更多
女痞
5楼-- · 2019-01-13 15:53

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.

查看更多
霸刀☆藐视天下
6楼-- · 2019-01-13 15:56

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.

查看更多
太酷不给撩
7楼-- · 2019-01-13 15:57

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!

查看更多
登录 后发表回答