How to modify color of inactive line in code assist in Eclipse?

天大地大妈咪最大 提交于 2019-12-09 12:26:47

问题


First of all, there is already a similar question, but these answers don't help.

As already mentioned in the topic, I'd like to modify the color of the inactive line in code assist (without changing other areas) because white on light grey background is hardly seen.

"Colors and fonts" just contain "Content assist foreground/background color", this only changes the foreground/background of the whole code assist but not of the active or inactive line. There doesn't seem to be an option for this. Is it possible to change this in a different way, maybe with some kind of stylesheet?


回答1:


After tinkering around for hours I found the solution. The related GTK class is GTKTreeView, the corresponding widget state is base[ACTIVE]. Unfortunately, a color change will affect other GTKTreeViews in Eclipse too (e.g. the tree view in project explorer, but for me it doesn't matter). I've set the background color of the list items to hex #AAAAAA so their look is a little bit darker now. I saved these settings als .gtkrc-eclipse in my home dir:

style "eclipse" {
        font_name = "Sans Condensed 8"
}

style "listitem"  {
        base[ACTIVE] = "#AAAAAA"    
}

class "GtkWidget" style "eclipse"
class "GtkTreeView" style "listitem"

..and the command of my Eclipse launcher looks like this:

env GTK2_RC_FILES=/usr/share/themes/Ambiance/gtk-2.0/gtkrc:/home/myuser/.gtkrc-eclipse '/opt/eclipse/eclipse'



回答2:


I'd say it's system-dependent. Try playing with system default colors on Preferences > Appearance > Customize > Colors. Depending on your Ubuntu theme the font could be unreadable sometimes.



来源:https://stackoverflow.com/questions/8628864/how-to-modify-color-of-inactive-line-in-code-assist-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!