Very large tabs in Eclipse panes on Ubuntu - eclipse

My question is very similar to Stack Overflow question Gigantic Tabs in Eclipse on Ubuntu.
I have tried the solutions presented, but they appear to be old. I have found a solution that nicely handles the toolbar and menus, but not a solution that reduces the size and padding of the disproportionately large tabs (and label) within the panes (see the tab "Package Explorer" in the screen below).
I am happy with the way my OS-wide GTK theme is customized and don't want to change that. Is there a quick fix to reduce the tab sizes of the panes in Eclipse?
I'm using Eclipse for Mobile Developers (Juno) on Ubuntu 12.04. I'll also mention that I really like the way Eclipse appears out of the box in Windows 7, so something similar to that would be ideal.
Here are the eclipse specific GTK styles I'm using:
style "eclin" {
GtkButton::default_border={1,1,1,1}
GtkButton::default_outside_border={1,1,1,1}
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=1
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=1
GtkToolbar::space-size=1
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
GtkExpander::expander_size=10
GtkExpander::expander_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::expander-size=12
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
font_name="Liberation Sans,Sans Regular 8"
}
class "GtkWidget" style "eclin"
style "eclin2" {
xthickness=1
ythickness=1
}
class "GtkButton" style "eclin2"
class "GtkToolbar" style "eclin2"
class "GtkPaned" style "eclin2"
Here is a screenshot of what my IDE looks like with the huge tabs:

You can edit Eclipse's CSS instead of messing with the GTK theme.
In your Eclipse directory find the file plugins/org.eclipse.platform_4.2.*/css/e4_default_gtk.css (there's an * in there, because I guess that the version may change in the future or may be different already). In this file there's a CSS class:
.MPartStack {
font-size: 11;
swt-simple: false;
swt-mru-visible: false;
}
And you have two possible solutions:
change font-size to something smaller
just comment out or remove font-size from this class (works well for me)
And that should do the trick.

Style of tabs can be changed in Eclipse 4.2 by editing CSS. You can change styles directly in Eclipse Preferences window after installing the E4 CSS editor plug-in.
Go to menu Help > Install new software, then install E4 CSS editor (Incubation) plug-in using Eclipse 4 update site (add this link: http://download.eclipse.org/e4/updates/0.12).
After restart, go to Window > Preferences, General > Appearance and now you can edit styles here for any selected theme.
I am using this style for tabs:
.MPartStack {
font-size: 9;
font-family: Liberation Sans;
swt-tab-renderer: null;
swt-tab-height: 22px;
swt-selected-tabs-background: #FFFFFF #ECE9D8 100%;
swt-simple: false;
swt-mru-visible: false;
}
You can specify tabs height using the swt-tab-height option. It's value sets tab height ignoring the font size.

I also wanted to reduce especially the horizontal space in order to fit more tabs, as Eclipse lacks multi-row tabs.
These instructions will go for any platform (not limited to e.g. Ubuntu/GTK).
What I did was:
Reduced the font size
Changed font to something horizontal-compact
Removed the X (close tab) button
...yielding the following result on my system (Win 7):
...and this is how it's done:
Check what CSS layout you're using: Preferences->General->Appearance-> check value of 'Theme:' listbox
Open the corresponding file in <eclipse folder>\plugins\org.eclipse.platform_<your version>\css, e.g. e4_default_win7.css
Modify .MPartStack entries to set font size and font, e.g.:
.MPartStack {
font-size: 8;
font-family: 'Arial Narrow';
swt-simple: true;
swt-mru-visible: false;
}
Add the following entry to remove the X (close icon):
CTabItem {
swt-show-close: false !important;
}
That's it!

Eclipse is now (4.5 Mars) defaulting to GTK3 on Linux. For 4.6 a fix seems to be alredy merged.
Changing SWT_GTK3 environment variable works for Eclipse Mars:
$ export SWT_GTK3=0
or set that variable inline with running eclipse
$ SWT_GTK3=0 /path/to/eclipse/eclipse
To kill it dead just drop this in the root as eclipse.sh:
#!/bin/bash
SWT_GTK3=0 exec env "${0%.sh}"

You may try the theme from https://github.com/jeeeyul/eclipse-themes.
After install this theme, apply it by choosing the theme in Window > Preferences > General > Appearence > Jeeeyul's themes.
And to solve the large tab problem, please refer to https://github.com/jeeeyul/eclipse-themes/wiki/Linux-Huge-Toolbar-Problem.
It's easy and beatiful. Enjoy it!

An alternative way is to select:
System settings > Universal access > Text size as small.

You can edit all small details about tab size here:

Related

How to increase font-size of Project Explorer in Eclipse IDE version 2019-09 use Spring Tool Suite plugin [duplicate]

I try to change the font size of package explorer in Eclipse from menu Window → Preferences → General → Appearance, and I fail to change the font size. How can I do that? I use Eclipse v4.2 (Juno) on Windows 7.
On Juno and up you can adjust that font by CSS.
Lookup the files in eclipse\plugins\org.eclipse.platform_4.2.x.y\css for your current style sheet (probably e4_default_win7.css), and then just add the following rule:
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
}
Update: stylesheets are in eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css folder since Eclipse 4.4 (Luna).
FYI:
From Eclipse v4.4 (Luna):
It looks like the CSS files are no longer in the old folder:
`eclipse/plugins/org.eclipse.platform_4.x.x.vy/css`,
They are moved to the new folder:
eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css
And you must select a theme to apply it, in the menu Windows → Preference → General → Appearance.
This worked for me:
.MPart Tree{
font-size: 8;
}
These are my settings and a screenshot of the IDE.
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree,
#org-eclipse-ui-views-ContentOutline Tree,
#PerspectiveSwitcher ToolBar {
font-size: 8px;
}
.MPartStack {
font-size: 8;
swt-simple: false;
swt-mru-visible: false;
}
You can lookup the CSS style files in eclipse/plugins/org.eclipse.platform_4.2.X.vY/css edit your current style (probably e4_default_win7.css).
Add something like this:
#org-eclipse-ui-jdt-PackageExplorer {
font-size: 20pt;
}
and hope you have a nice and large font (I did not check it myself).
Pro tip: Next time you need to find the CSS Id for a part of the UI, use CSS Spy which you can open with SHIFT-ALT-F5 (after you have installed it).
This worked for me using version 2019-09 on Windows 10:
Locate the directory C:\Users\johndoe\.p2\pool\plugins in File Explorer, replacing "johndoe" with your own Windows user ID.
Depending on what you have done in the past with Eclipse, you should see one or more directories with names that start with org.eclipse.ui.themes.
Select the one with the most recent date modified. In my case its name was org.eclipse.ui.themes_1.2.700.v20190826-0816.
Within that directory open the directory named css.
Open the file named e4_default_win.css in a text editor, and append something similar to the following at the end of the file:
Tree {
font-size: 24px;
font: Mistral; }
Don't pick those specific values! You should pick the font and font size you want. I deliberately made poor choices only to make the effect of those settings obvious in the screen shot below.
Save the file and restart Eclipse. You should see that the font has been changed in the Project Explorer and Package Explorer views, and a lot of other places as well:
Just be clear, the name of the file I edited was C:\Users\johndoe\.p2\pool\plugins\org.eclipse.ui.themes_1.2.700.v20190826-0816\css\e4_default_win.css. The name of the file you edit won't be exactly that, but it should be similar.
On Ubuntu 14.04 (Trusty Tahr) this was the best choice for me:
.MPart Tree{
font-size: 10;
}
In my case I'm using DevStyle plugin with Spring Tool Suite 4.
The font size of project explorer can be changed going to Eclipse menu bar:
Window
Preferences
DevStyle
Extras
Explorer font size
This setting is saved into workspace folder:
\workspace\.metadata\.plugins\com.genuitec.eclipse.ui.common.platform\extra-styling.css
I tried edit directly in file but when open Eclipse the file was overwritten
Using STS 4.8.0.RELEASE based on Eclipse 2020-09 (requires a JDK11)
Finally, from Eclipse 2020-09 (4.17) there is an option "Tree and Table font view" in Window -> Preferences -> General -> Appearance -> Colors and Fonts which changes size of the font in Package Explorer, among others.
If it helps you to spot the setting easier , this is a screenshot how to change the font elsewhere than the font from the editor window
Eclipse is using native Windows widgets and their settings can only be changed from Display Properties / Settings / Advanced / General properties tab. There you can change your screen DPI to alter font sizes.
In Eclipse 4.7.x the CSS files are under eclipse⁩/⁨plugins⁩/⁨org.eclipse.ui.themes_1.2.1.v20170809-1435⁩/⁨css⁩/
In my case I use the dark theme for OSX, so I opened the file e4-dark_mac.css and added the font-size line:
CTabFolder Tree, CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
font-size: 13pt; // new
}
Thanks to Veger's reply, I successfully changed the font of my PHP Explorer in PHP Perspective (with PDT installed). The following CSS code,
#org-eclipse-php-ui-explorer Tree {
font-family: Consolas;
font-size: 21px;
}
are added into my "eclipse-4.3\plugins\org.eclipse.platform_4.3.1.v20130911-1000\css\e4_default_win7.css" file.
You may choose a different CSS file, depending on the theme you choose through Preferences → General → Appearance: "Theme" drop-down list).

Eclipse issue with linuxmint

I'm facing the same issue described in the picture : http://dentrassi.de/wp-content/uploads/eclipse1.png?cd7ade .
Basically the size of the toolbars and size of the eclipse is huge and ugly! I have searched the internet for a solution but I didn't find a fix.
Does anyone know how can this be fixed ?
I found 2 links to fix the eclipse issue:
http://blog.nanthrax.net/2012/07/change-tab-font-in-eclipse-juno/
https://bugs.launchpad.net/linuxmint/+bug/1168281
But still the toolbar icons are large. At least it looks better. If I find the full fix i'll edit my post.
I was able to identify a good solution for this problem look at the next screenshot ...
https://drive.google.com/file/d/0B5XuLGzBQTGBNy10bVdxNExkclk/edit?usp=sharing
[Linux Mint 14 Nadia]
Open a shell or exploring window and navigate to:
/usr/share/themes/Mint-X/gtk-2.0/gtkrc
Then make a backup and replace with the file in this link here
https://drive.google.com/file/d/0B5XuLGzBQTGBOEVIZ19BcWhVM28/edit?usp=sharing
... it all was matter of playing with the CSS properties and make the padding values and widths smaller.
(Note: I also made some small adjusts on the CSS IDE level as follows:)
Windows > Preferences > General > Appearance
I replaced this CSS Entry on all themes:
/*
.MPartStack {
swt-tab-renderer: null;
swt-selected-tabs-background: #FFFFFF #ECE9D8 100%;
swt-simple: false;
swt-mru-visible: true;
}
*/
.MPartStack {
font-size: 9;
font-family: "Droid Sans";
swt-simple: false;
swt-mru-visible: false;
}
And then selected a smaller font:
Windows > Preferences > General > Appearance > Colors and Fonts
Open to display Java item and select Java Editor Text font
Click Edit and select a smaller and better font.
Have fun, hope it helps!

How to change autocomplete font size on Komodo Edit 7?

I've recently upgraded to Komodo Edit 7 from 6.1, and while the upgrade has been rather smooth, the font size for the autocomplete suggestion's font size suddenly became huge
Is there any way to change this?
Found the answer on Komodo Edit forums: http://community.activestate.com/node/7289
To fix this, you need to create (if you haven't done so already) a userChrome.css file in the <application data folder>/XRE/chrome (app data location for different operating systems) folder to override the original styling of the autocomplete menu. Copy the code below into the file and save, then restart Komodo and the menu font size should return to normal.
scintilla > panel[anonid="autocompletepopup"] .ko-autocomplete-item {
font-size: 100% !important;
}

How do I change the background color of the Navigator view in eclipse?

I didn't find any option for that, so I suspect that some views follow the color pattern of the operating system. I'm currently using OS X, and it seems like changing the default background color it's not possible either.
What I'm trying to accomplish is to create a dark background theme, but customization seems only possible on some of the eclipse views.
For platforms where eclipse uses gtk (Linux for example) one can use a custom gtkrc file (place it for example in the eclipse base directory)
style "eclipse" {
base[NORMAL] = "#FDF6E3"
fg[SELECTED] = "#FDF6E3"
base[SELECTED] = "#073642"
fg[NORMAL] = "#073642"
text[NORMAL] = "#073642"
base[ACTIVE] = "#073642"
}
class "GtkWidget" style "eclipse"
And a custom start script for eclipse
#!/bin/sh
GTK2_RC_FILES=gtkrc ./eclipse
Got the solution from http://blog.sarathonline.com/2008/10/solved-eclipse-looks-good-in-ubuntu-now.html
Combine this with the color themes plugin for coloring the editors
My case is: Eclipse ver. 2018-09, Win 10.
Eclipse install folder: C:\eclipse\eclipse-2018-09
I compared 2 files:
1) C:\eclipse\eclipse-2018-09\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css\e4_basestyle.css
2) C:\eclipse\eclipse-2018-09\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css\e4-dark.css
And find out css selector "CTabFolder Tree, CTabFolder Canvas" is present in dark, but absent in basestyle.
Add this selector in file "e4_basestyle.css"
CTabFolder Tree, CTabFolder Canvas {
background-color: #dddddd;
color: #000;
}
and You can tune color for nav view.
Then select theme "Light" in Preferences->General->Appearance and click "Apply".
As mentioned in "Changing UI color in Eclipse":
Each time you see white or gray color, this is more than likely related to OS system colors.
(that is, for everything which is not an editor or a custom view).
This is likely the case for the navigator view, as reminded in "How to change background of all VIEWS in Eclipse IDE ?"
When Git is present, Project Explorer colors can be altered via Preferences > General > Apparearance > Colors and Fonts > Git

Changing UI color in Eclipse

I'm aware of color themes for Eclipse: I've used it to change most of the editor colors, and that's great.
But that wasn't enough, there's still too much white. How to change it? (It hurts my eyes.)
I've searched in the preferences (both using Eclipse itself and editing the files) for instances of white (255,255,255) and changed them all. Looks like I'm missing something.
Each time you see white or gray color, this is more than likely related to OS system colors.
In other word, to truly have an Eclipse full dark theme, you need first to have a dark theme for your OS, and then your Eclipse will follow.
Here is an example on a Windows7, modifying just one parameter:
alt text http://img92.imageshack.us/img92/5053/eclipsered.png
Probably not the answer you're looking for, but the IntelliJ community edition is an excellent free IDE and is very easy to use. The background colours can be set and changed to many colours. There are also a number of free plugins which can customize backgrounds and the look and feel. Well worth a look if you don't find exactly what you're looking for with Eclipse.
I see you're on the Mac - the easiest thing to do would go to System Preferences -> Accessibility -> Seeing -> Display -> "White on Black". It will invert everything on your screen though, I don't know, if you'd like that?
YES, THERE IS A WAY TO DO IT
You will need to configure 3 things in order to get your dark UI.
1) Java Editor Colors
This is the source code edition area. You can use http://eclipsecolorthemes.org/ for the editor part, though those colors can be manually edited by default.
2) Eclipse UI
The UI colors can be edited with the addin Chrome Theme which can be found in the eclipse market place or in the following link https://github.com/jeeeyul/eclipse-themes/. If you want a dark theme just edit away until you find the colors that suit you.
3) Final touches
After doing the previous steps, some colors will still match the OS colors. To darken what's left, just get the pre-baked Dark Juno theme from https://github.com/eclipse-color-theme/eclipse-ui-themes. Download the zip file and unzip it into your dropins folder (which is located in your eclipse folder). If the dropins folder doesn't exist, just create it.
Restart eclipse and you are set.
You can try these steps:
Find the path: ~/.p2/pool/plugins/org.eclipse.ui.themes_*.*.****.v********-****/css/e4_basestyle.css;
Use a text editor (example: Sublime Text 3) to open e4_basestyle.css if you used default theme config;
Append this code and save
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px;
font-family: "DejaVu Sans Mono for Powerline";
background-color: RGB(223,238,223);
},
#org-eclipse-ui-views-ContentOutline Tree,
#PerspectiveSwitcher ToolBar {
font-size: 10px;
font-family: "DejaVu Sans Mono for Powerline";
background-color: RGB(223,238,223);
}
Restart Eclipse. It is like this: result