Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

enter image description here

"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?

like image 518
Bevor Avatar asked Dec 25 '11 08:12

Bevor


2 Answers

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'
like image 125
Bevor Avatar answered Oct 07 '22 08:10

Bevor


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.

like image 42
jFrenetic Avatar answered Oct 07 '22 08:10

jFrenetic