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

2

7

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?

Tanjatanjore answered 25/12, 2011 at 8:35 Comment(0)
T
6

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'
Tanjatanjore answered 25/12, 2011 at 12:4 Comment(2)
Glad you found a solution. If that works for you, now you may accept your answer.Daina
tnx aloot! As I begin to understand now (Im' an ubuntu noob) -- ubuntu/unix is mostly like Ikea -- construct yourself :)Dilorenzo
D
1

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.

Daina answered 25/12, 2011 at 9:23 Comment(2)
As I said I don't like to change other areas and system defaults at all. Moreover there are only 8 color settings. None of them can distinguish between selected and inactive text. If I could, I'd need to know what GTKWidget attribute it is too. So I could make Eclipse specific settings. I've already done that with the common text size of eclipse: style "eclipse" { font_name = "Sans Condensed 8" } class "GtkWidget" style "eclipse"Tanjatanjore
Honghe.Wu's comment: "The Ubuntu 'adwaita' theme is a better contrast of background color and text, because the background color is blue. But as you says, it may change the whole Ubuntu theme. And I apply your own solution, it looks better now. Thank you."Gould

© 2022 - 2024 — McMap. All rights reserved.