由于颜色,Eclipse 内容辅助中的选定条目不可读

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6424800/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:28:53  来源:igfitidea点击:

The selected entry in Eclipse content assist is unreadable because of colours

eclipsecolorsmenueditor

提问by Bjarke Freund-Hansen

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.

在我的 Eclipse 安装中,内容辅助菜单中的选定条目几乎无法读取,因为颜色是白灰色的。见下图。

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 ThemeRecognEyes, but that should only affect the editor as far as I understand.

我可以从 eclipse 首选项更改列表中未选择条目的背景和文本颜色,但所选条目始终为相同颜色且始终不可读。我使用Eclipse Color Theme RecognEyes,但据我所知,这只会影响编辑器。

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

如何使上下文辅助菜单中所选条目的文本可读?

Update

更新

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

在阅读了m1shk4 的回答之后,Eclipse 似乎确实从当前的 gnome 主题中获取了它的颜色。然而,它以一种奇怪的方式做到了这一点。

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 notthe background text colour.

但是被选中条目的背景颜色是windows的背景颜色,但是被选中条目的文本不是背景文本颜色。

See image below for an illustration.

有关说明,请参见下图。

Color mapping from gnome theme to eclipse

从 gnome 主题到 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.

这个问题似乎与 Ubuntu 中的默认 gnome 主题相当具体。切换到另一个 gnome 主题为我解决了这个问题。

采纳答案by George W. Condomitti

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:

创建一个文件 ~/.gtkrc-2.0 并将此内容添加到文件中:

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.

然后只需为 Unity 设置一个新主题(在“配置”>“外观”中)并再次设置为之前的主题(例如 Ambiance)。这将读取上面创建的新文件,新颜色将在 eclipse 中生效。

回答by Jose Manuel Ferreira Benavides

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

我正在使用 Eclipse Neon 并使用 Eclipse 颜色主题。

I've solved this issue by:

我已经通过以下方式解决了这个问题:

Window-> Preferences-> General-> Appearance: 
->Uncheck "Use mixed fonts and colors for labels."

回答by Mia

Windows > Preference > General > Appearance > Color and Fonts

Windows > 首选项 > 常规 > 外观 > 颜色和字体

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

基本 > 内容辅助背景色、内容辅助前景色:

Preference

偏爱

and voilà!

瞧!

Content Assist

内容辅助

回答by Mykhailo Gaidai

Updatescreenshot

更新截屏

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

界面是俄语,但我认为很明显,您正在寻找的颜色与Selected Items条目相对应。在我的截图它的淡蓝色背景黑色的前景

回答by Adrian Muraru

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.

如果您使用的是 Ubuntu / Unity,请继续安装并启动 gnome-color-chooser。全局颜色 -> 默认配置,输入字段 -> 根据您的需要选择和更改 fg 和 bg 颜色。

回答by Andrei

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

我在 Windows 7 上有同样的问题。我发现内容辅助框的文本颜色(未选择的文本)可以在以下位置更改:桌面->个性化->窗口颜色->高级外观设置->项目->消息框

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

唯一的问题是不能为 MessageBox 设置背景颜色。-> 其他人有什么帮助吗?

At least this way you can read something...

至少这样你可以阅读一些东西......

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

注意:请注意,许多其他应用程序可能依赖于 messageBox 颜色!

回答by 8forty

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

通过编辑主题中的文件(我使用 Radiance),我能够在 Ubuntu 12.04 中解决此问题:

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

须藤 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

顶部是一个关键的“gtk-color-scheme”,其中包含一组稍后在文件中使用的颜色变量。我进行了这些更改: 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.

进行更改后,将您的主题更改为其他主题,然后再返回,大多数情况看起来都会更好!我确实必须重新启动 eclipse 才能更新窗口边框中的字体。

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.

请注意,不幸的是,这些更改有时会在更新过程中被覆盖。可能有一种方法可以使用 ~/.gtkrc-2.0 来做同样的事情,我只是对那个文件一无所知。