Monday, February 18, 2013

Fixing spacing issue in Eclipse in Gnome

Sometimes I run Eclipse on my 13" laptop without an external monitor. This used to be a really problematic, because package explorer/outline were displaying only a few items because of the huge gaps between rows. It was just a pain to me, but nothing really serious. I thought it is intentional and nothing can be done about that. But in the open source world, it is good to be vocal. Someone ( David Mansfield) reported a bug
Bug 910812 - line spacing in tree (specifically in eclipse, e.g. package explorer) is way too large.
and attached following screenshots:
This is how Eclipse used to look like on Linux:
Screenshot of Package Explorer running in a past versions of Fedora.
And this is how it looks like now:
Current appearance of Package Explorer. Note the spacing.
It's arguable which one is better. The latter looks really nice if you run Eclipse on a HD monitor, but it's barely acceptable when using something smaller.

There's solution for that - just set the style of a GTK tree to have no vertical separator - you may use the command attached below:
cat >> ~/.gtkrc.mine << EOF
style "tree" {
  GtkTreeView::vertical-separator = 0
class "GtkTreeView" style "tree"

Eclipse does not look nicer after that, but it's a way more ergonomic, isn't it?

Happy hacking!


  1. This comment has been removed by a blog administrator.

  2. Extremely helpful! Thank you so much for sharing.

  3. Sorry if this is double ..

    I recently try to get stuff working on CentOS7/RHEL7. I am encountering exactly the problem you are describing in this post, so I created the file as described and confirmed it is there. I do however not see any improvement in the way eclipse is rendering that treeview. Is there an additional step to trigger the file .gtkrc.mine?