Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gigantic Tabs in Eclipse on Ubuntu

EDIT: For anyone coming to this question through searching, you can install a Gnome Theme called Clearlooks Compact to shorten your tabs in Eclipse. This will free up a lot of screen space. You can also check out the answer below to learn how to make the tabs more horizontally compact.


Short version: How do I make a short version of Eclipse's tabs & toolbars in Ubuntu?

I've been looking around for a fix to this on Google, but to no avail. With any GTK theme, I still have this same issue and it's very, very annoying--to the point where I've stopped using Eclipse in favor of gEdit. However, after running pylint from a terminal too. many. times. I've decided I need to find a solution to this issues with Eclipse so I can have PyDev back. Here's what the tabs look like:

alt text http://c0496682.cdn.cloudfiles.rackspacecloud.com/big-tabs.png

As you can see, not only are the tabs exaggerated, but the toolbar is, too: so is the toolbar on the bottom; so are the tabs in the bottom pane. Overall, it's eating up a lot of screen space, which is a hard item to come by on a 17" screen. Any suggestions/fixes?

like image 445
Zack Avatar asked Apr 30 '10 09:04

Zack


5 Answers

This can be solved changing your GTK settings;

gedit ~/.gtkrc-2.0

Then add this;

style "gtkcompact" {
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=0
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
class "GtkWidget" style "gtkcompact"

borrowed from http://ubuntuforums.org/showthread.php?t=1465712

like image 101
Varun Mehta Avatar answered Oct 05 '22 09:10

Varun Mehta


In addition to @Varun Mehta answer, I recommend the following tips for Eclipse 4 (Juno), whose interface is partially dictated and configurable by CSS rules:

In YourEclipseDir/plugins/org.eclipse.platform_4.x.y.v2012zzzzzzzz/css, edit:

  • e4_basestyle.css
  • e4_default.css
  • e4_default_gtk.css

... and adjust those files. I use the following set of tweaks:

  • set all the margin-* and padding to 0
  • set swt-shadow-visible: false everywhere you find it, to get rid of those huge shadows
  • set .MPartStack {font-size} to something smaller than 12

Finally, remember you can disable the toolbar. In 4.0, its state wasn't remembered across sessions, but it seems like the issue is solved in 4.2.1

Bonus resources: Eclipse4/CSS will get you started on Eclipse4 CSS, E4/CSS/SWT Mapping lists other interesting CSS attributes, and CSS Spy will help you inspect the UI.

Screenshot of what I end up with: enter image description here

EDIT: see also How to remove the close (×) button from Eclipse Juno tabs?

like image 41
Ronan Jouchet Avatar answered Oct 05 '22 09:10

Ronan Jouchet


In Addition to Ronans answer, it is possible to change the height of the tabs directly in Eclipse Juno.

edit the css file of your current style (e.g. e4_default_gtk.css) and add

CTabFolder {
   tab-height: 16px;
}

Note: CTabFolder ... not add this to CTabFolder Canvas!

like image 40
Zarokka Avatar answered Oct 05 '22 08:10

Zarokka


I too have suffered from this quite a bit, before I found the solution by changing the general appearance of my IDE.

You can try and customize the look-and-feel or you Eclipse Environment from,

Go to : Window -> Preferences -> General -> Appearance.

try setting,

  1. Current Presentation to " Default ".
  2. Enable " Traditional Style Tabs " (for rectangular tabs.)
  3. Disable Animation ( if you don't like swoosh effect.)
like image 34
phoenix24 Avatar answered Oct 05 '22 08:10

phoenix24


Note: the Default Eclipse 4 just got a bit better with bug 420238 closed:

[CSS] Reduce whitespace usage in the default Eclipse themes

Before:

http://blog.vogella.com/wp-content/uploads/2014/01/Java-test-src-test-Main.java-vogella-Development-Tools-_009.png

After:

http://blog.vogella.com/wp-content/uploads/2014/01/Java-test-src-test-Main.java-vogella-Development-Tools-_010.png

See Lars Vogel's article about it:

If you fire up the next Eclipse 4.4 milestone build, Eclipse uses much less whitespace and leaves more space for the important content.

(That would be 4.4 M5)

While this is on a technical level a trivial change, I hope that this will improve the initial perception people have in using Eclipse.

A big thanks to Daniel Rolka, Robin Stocker and Dani Megert for doing the majority of the work and a big thanks all involved parties in the Bug report to get this change accepted.

like image 32
VonC Avatar answered Oct 05 '22 10:10

VonC