I have just installed Ubuntu 12.04 and I have made no modification to it.

I have installed Eclipse Juno. When I press Ctrl+O, the outline appears. However it appears as white letters over a black background. I doubt Eclipse would have made this by default, it's ugly and hard to read. It most likely takes a configuration from the OS.

How to change that to the usual black over white?

ps: Sorry for briefly putting the first answer as my accepted answer. I thought it could solve the problem, but after trying, it actually doesn't. Can I get more help on that please ?

1 Answer
1

SWT supports a number of "backends", which means that it passes its rendering requests to some other native library.

In the case of Ubuntu, it uses GTK2 as its backend.

So when Eclipse requests SWT to do some graphics operation, SWT asks GTK2 to do it.

But sometimes SWT and GTK2 don't play together nicely, and SWT can misunderstand the style information of GTK2. You see, Eclipse uses some widget designs (like that "cool bar" with the curve) that are not standard GTK2 widgets. And the widget customizations are implemented within SWT itself, not within GTK2. So SWT tries to "guess" what appropriate color type from GTK2 would be the most appropriate.

Since Ubuntu's theme is very non standard among GTK2 themes, it appears that SWT guesses wrong about the intended colors.

I would suggest looking through Ubuntu Software Center for some other GTK2 engines and/or themes, such as murrine or clearlooks, and install them. Then, you can use gnome-tweak-tool, or manually select your GTK2 theme by creating a symlink from /usr/share/themes/<whatever-theme>/gtk-2.0/gtkrc to ~/.gtkrc-2.0. This should, hopefully, make SWT pick up on the new GTK2 theme when it renders Eclipse, and you should at least get interesting results ;)

Since Eclipse Juno isn't in the Ubuntu official repositories (or is it?!? you tell me!) I don't think this can be considered a proper Ubuntu bug, but you're welcome to file a defect in Launchpad against the Eclipse package if the built-in Ubuntu packages of Eclipse exhibit the same behavior. As far as I know, the Eclipse packages in Ubuntu 12.04 are for Eclipse Indigo, the prior release, because Juno wasn't out by the time 12.04 was released.

Thanks for the answer, it's really interesting. I tried what you mentioned, but unfortunately it doesn't work, it's still written in white over black with clearlooks or murrine. By the way, the .gtkrc-2.0 didn't exist, I don't know if that's what you expected. But I created it and linked to what you said, and the end result is still the same, after restarting eclipse.
–
NaomiJOJul 27 '12 at 22:39