由于颜色原因,Eclipse 内容辅助中选定的条目无法读取

发布于 2024-11-16 08:21:08 字数 1075 浏览 3 评论 0原文

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

突出显示的条目不可读

我可以从 Eclipse 首选项更改列表中未选定条目的背景和文本颜色,但是选定的条目始终是相同的颜色并且始终不可读。我使用 Eclipse 颜色主题 RecognEyes,但据我所知,这只应该影响编辑器。

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

更新

阅读后m1shk4 的答案确实看起来Eclipse 从当前的 gnome 主题中获取颜色。然而它以一种奇怪的方式做到这一点。

内容辅助“窗口”的背景颜色是输入框的背景颜色,文本颜色是输入框的文本颜色。这一切似乎合乎逻辑。

然而,所选条目的背景颜色是窗口背景颜色,但所选条目的文本不是背景文本颜色。

请参见下图的说明。

从 gnome 主题到 eclipse 的颜色映射

有人知道如何修复或解决此问题吗?

< strong>工作解决方法

看来这个问题对于 Ubuntu 中的默认 gnome 主题来说相当具体。切换到另一个 gnome 主题为我解决了这个问题。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

左岸枫 2024-11-23 08:21:09

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

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.

凤舞天涯 2024-11-23 08:21:09

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

唯一的问题是无法设置MessageBox的背景颜色。 ->有其他人的帮助吗?

至少这样您可以阅读一些内容...

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

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!

画中仙 2024-11-23 08:21:09

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

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

顶部是一个键“gtk-color-scheme” " 以及一堆稍后在文件中使用的颜色变量。我进行了这些更改: tooltip_fg_color:#000000 selected_fg_color:#000000 tooltip_bg_color:#f5f5b5

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

请注意,不幸的是,这些更改有时会在更新过程中被覆盖。可能有一种方法可以使用 ~/.gtkrc-2.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.

电影里的梦 2024-11-23 08:21:08

不确定它是否仍然及时,但这可能会帮助所有遇到同样问题的人,就像我一样:

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

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

class "GtkTreeView" style "eclipse_fix"

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

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.

救星 2024-11-23 08:21:08

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

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

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

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."
天赋异禀 2024-11-23 08:21:08

窗口>偏好>一般>外观>颜色和字体

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

Preference

瞧!

内容辅助

Windows > Preference > General > Appearance > Color and Fonts

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

Preference

and voilà!

Content Assist

陌路终见情 2024-11-23 08:21:08

更新
screenshot

界面是俄语的,但我认为很明显,您正在寻找的颜色对应于 Selected项目条目。在我的屏幕截图中,其背景为浅蓝色前景为黑色

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文