Skip to content

Linux Huge Toolbar Problem

mateusz-matela edited this page Oct 1, 2016 · 8 revisions

Eclipse 4 on Linux GTK can look terrible. Main reason is to Huge widget size. The solution below depends on the GTK version you are using. Eclipse Mars uses GTK 3 by default when installed in your system, previous versions use GTK 2. Also if you are using Linux Mint, you will see horrible background of Toolbars.

GTK 2 - Easy Fix

You can fix it by defining gtk 2.0 layout.

After installation of Jeeeyul's Eclipse Themes, You can find Launch GTK 2.0 RC Wizard from toolbar menu.

Linux Menu

This menu will shows a wizard that will download GTK 2.0 Runtime Configuration and ask restart eclipse. Then choose a preset that you want to re-compute minimum tab height.

Result

GTK Compact

Undoing

What if you want to revert GTK configuration, Just remove ~/gtkrc-2.0 file.

$ rm ~/.gtkrc-2.0

GTK 3

You'll need to customize your GTK3 theme. A general way to override current theme style is to add/edit ~/.config/gtk-3.0/gtk.css. You can also directly edit your theme files, which can usually be found under /usr/share/themes or ~/.themes. The actual file depends on your theme, but most of them have a gtk-3.0/gtk-widgets.css.

The minimum Tab height is calculated based on this SWT component, so you can tweak it's CSS selector below to adjust it. For most of the themes just removing the padding should do the trick:

GtkToolbar#swt-toolbar-flat {
    padding: 0px;
}

Note: in newer versions of Eclipse (probably since 4.6) the #swt-toolbar-flat selector is no longer valid. You can try without it, but then it will affect all the other GTK apps as well (an idea to explore: use $XDG_CONFIG_HOME variable in eclipse startup script to load custom gtk.css from a folder made specifically for Eclipse).

Feedback

I am not good at linux and GTK. If you have better example or explanation. Please update this document. What if you defined better .gtkrc-2.0 then please make a pull request.

Clone this wiki locally