Eclipse,将鼠标悬停在关键字上时更改弹出文本背景颜色

标签 eclipse ubuntu-10.04

Ubuntu 10.04.1 新主题默认所有 Windows 背景颜色设置为黑色。
我不想改变这一点。

在 Eclipse 中,由于 10.04.1,界面没有太大变化 - 除了一件烦人的事情:
当鼠标悬停在关键字(例如变量)上时,该关键字的类型 (...) 将显示在一个小的弹出窗口中。
自 10.04.1 以来的问题是文本为黑色,而背景也是黑色。

有没有办法在 Eclipse 中更改背景颜色?

最佳答案

2018 年 12 月更新:如 howlger 中所述的answer , Eclipse Oxygen 4.7 (June 2017)现在包含一种在弹出窗口中配置背景颜色的方法:

参见“Colors in interactive popups

Interactive popups like JDT's Quick Outline don't use the platform's tooltip colors any more, since those were sometimes hard to read.

旧样式:

https://www.eclipse.org/eclipse/news/4.7/images/old-popup-color-constants.png

新风格:

https://www.eclipse.org/eclipse/news/4.7/images/new-popup-color-constants.png

  • 转到窗口 > 首选项:常规 > 外观 > 颜色和字体
  • 然后更改基本 > 信息背景颜色。

在同一个颜色和字体部分中,您会发现:

  • Code assist

    • Basic > Content Assist background color -> change
    • Basic > Content Assist foreground color -> change
  • java doc

    • Java > Javadoc background ( overrides default: information background color) -> change
<小时/>

原始答案(2010-2012)

所有各种弹出窗口背景颜色均在 Preferences > Java > Editor 中管理(如 bug 133615 中的完成列表弹出窗口颜色)。
其他背景颜色位于常规>外观>颜色和字体中(在过滤器字段中输入背景)。

但是类型弹出窗口似乎坚持系统颜色,这就是您看到黑色背景的原因。 如果确实如此,则值得将其报告为错误。

<小时/>

OP 确认事实并非如此,实际上:

It was in Preferences > C/C++ > Editor > Source hover background, and had to untick the "System default" (because the shown color was light-gray!)

<小时/>

在 Ubuntu 12.04+ 上,帖子“How to change tooltip background color in Unity?”还提到:

/usr/share/themes/Ambiance/gtk-2.0/gtkrc

最近的帖子(2012 年 12 月)“Eclipse Papercut #10 – Eclipse on Ubuntu: Fixing the black background color in hover ”(来自 Lars Vogel )证实:

The relevant properties are tooltip_fg_color and tooltip_bg_color.
Just search for these values, the position changes sometimes between releases, currently they are at the very top of the file.

The following setting uses more reasonable colors.

tooltip_fg_color:#000000
tooltip_bg_color:#f5f5c5
<小时/>

pointhi添加in the comments :

I also had to set the environment variable SWT_GTK3=0 before starting eclipse to get it working.

关于Eclipse,将鼠标悬停在关键字上时更改弹出文本背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3571850/

相关文章:

eclipse - 如何让 Eclipse 在缩进处而不是在行首添加行注释?

java - Eclipse 插件在代码中使用标准 Format 函数

c - 为什么sigprocmask用于阻止SIGCHLD在以下代码中传递

python "ImportError: cannot import name urandom"

tomcat - tomcat 上的达文波特

windows-7 - XAMPP 和 LAMP 之间有什么重大区别吗?

java - 没有合适的组件供应商 - Buckminster

java - 如何使工作区文件夹级别的构建脚本在 Eclipse Project Explorer 中可见?

java - Eclipse Mars 在 Java 8 Update 71 后无法启动

.net - 更新到 2.10.1 后 webApp 不起作用