Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enormous tab and icon padding in Eclipse 4.11 on Ubuntu 19.04

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

    • e.g. this answer from Q: Gigantic Tabs in Eclipse on Ubuntu
  2. "Apply a design fix with CSS."

    • e.g. this answer from Q: Very large tabs in Eclipse panes on Ubuntu

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:

  • How to remove the HUGE padding for tabs and icons in Eclipse on Linux Mint 17.3 Xfce edition?
  • Can I make Eclipse on Ubuntu look more compact?
  • How to change the font size of the Eclipse editor tab's title

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

like image 251
zb226 Avatar asked Sep 01 '25 01:09

zb226


1 Answers

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
like image 145
Martin Avatar answered Sep 03 '25 00:09

Martin