3
votes

When running a fresh install of a recent Eclipse on a fresh install of a recent Ubuntu, you'll see this:

(screenshot follows)

For reference, this much more compact view is what I'm used to look at on a Windows machine:

enter image description here

There's several related questions and answers for older versions of Eclipse, falling into two categories:

  1. "Apply a design fix on GTK2 level. If your Eclipse uses GTK3, force it to use GTK2 instead."

  2. "Apply a design fix with CSS."

Now, in my experience with Eclipse 4.11 aka "2019-03"...

  1. I can't force GTK2 usage anymore. With ./eclipse --launcher.GTK_version 2 I get:

The Eclipse (...) launcher no longer supports running with GTK + 2.x. Continuing using GTK+ 3.x.

  1. CSS hacks to plugins/org.eclipse.ui.themes.../css/e4_default_gtk.css don't have any effect. I tried to edit this file a lot but it just never seems to do anything.

So my question is what do I have to do to get rid of these space wasters? And more generally, what's the designated way to tweak design parameters with new versions of Eclipse? There's also word of a CSS editor plugin for Eclipse itself, but it seems to be abandoned.


I'll be collecting links to other questions dealing with related Eclipse GUI problems:


According to this thread, GTK2 support has been dropped with Eclipse 4.10 aka "2018-12".

2
I'm not understanding the question, you can resize panes and Eclipse will remember that. OTH, what do you need the hacks for specifically?LMC
@LuisMuñoz I'm not talking about panes, I want to decrease the used space of Eclipse's tabs. You know, tabs, like in a web browser, cf. wikipedia. The handles with which you select one of multiple panes or subwindows.zb226
Just a shot in the dark, compare screen dpi for both OS.LMC

2 Answers

2
votes

Aahhh welcome to the world of pain: Linux and themes. This will be a long answer to fight a lot of outdated information that I found on the net.

What does not work (anymore) and why:

  • Switching back to gtk2.0+gtkrc: The most recent eclipse versions do simply not support GTK2 anymore. Don't bother trying.
  • Using Eclipse themes or manipulating the eclipse css. In e4_default_gtk.css/.MPartStack there is a paramater for the tab height, but since the buttons (minimize/close) stay the same size, look and handling stay bad. Themeing is still a good option to optimize the look & feel.
  • This hint here does not work either: https://github.com/jeeeyul/eclipse-themes/wiki/Linux-Huge-Toolbar-Problem but goes into the right direction.

How to actually reduce the tab and icon padding:

  • Tab height is forced by the icon size/tabbing and this is defined in the GTK3 configuration. Tbh I don't know which parameters set that.
  • But I found several themes that result in a compact and nice eclipse look (see list below). But you can not use them as global themes because some application really rely on the icons sizes+paddings or otherwise look very ridiculous. This is a conflict in such a large open source project that the look and feel is not treated consistently and has additional troubles handling HiDPI monitors.
  • Solution: Enable a compact theme for eclipse specifically. E.g.

env GTK_THEME=Clearlooks-Phenix /opt/eclipse/eclipse

Example themes resulting in a compact eclipse look:

  • Clearlooks-Phenix
  • Adwaita-compact
  • Xfce-orange

Usual themes that will make almost everything look good except eclipse:

  • Adwaita
  • Greybird
0
votes

I recently had the same problem.

When I used eclipse 2020-03 on Ubuntu 16.04 I didn't notice any problems, but yesterday I switched to Ubuntu 20.04, and I faced the problem of big spacing in tree views - It just doesn't let you work.

I exclude problems with eclipse since I used the same installation. This lead me to GTK. Ubuntu 16.04 uses the GTK version before 3.20, and 18.04 and 20.04 use versions after 3.20 which contain some changes related to CSS.

I found that in /usr/share/themes/Ambiance/gtk-3.0/gtk-widgets.css is parameter set -GtkTreeView-vertical-separator: 0;, but in /usr/share/themes/Ambiance/gtk-3.20/gtk-widgets.css there is no such parameters.

Adding below parameters in /usr/share/themes/Ambiance/gtk-3.20/gtk-widgets.css resolved my problem:

  treeview {
      -GtkTreeView-vertical-separator: 0px;
      -GtkTreeView-horizontal-separator: 0px;
      -GtkTreeView-expander-size: 16;
  }

Note: I am not sure if it helps if Eclipse is instaled via snap, since in /snap folder I also found some theme files.