curvy tab in eclipse 4 RCP app. Even though i am adding SHOW_TRADITIONAL_STYLE_TABS=false to my plugin_customization.ini file. I aqm not able to find out any changes in the display of the tab.
This should be managed through the E4 CSS engine, and your associated CSS stylesheet for your RCP app should include something in the lines of:
.MPartStack {
swt-tab-renderer: null;
swt-selected-tabs-background: #FFFFFF #ECE9D8 100%;
swt-simple: true;
swt-mru-visible: true;
}
(from the page "Eclipse4 CSS", so it is for Eclipse4 itself, but could apply to your RCP as well)
If you have a swt-simple: false;, you should see curvy tabs.
Related
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).
I develop a rcp product with eclipse kepler(Eclipse for RCP and RAP Developers), but set tab style not work.
I tried two ways
1.config.xml
<extension id="product" point="org.eclipse.core.runtime.products">
<product application="cn.desktoptool.application" name="cn.test">
<property name="preferenceCustomization" value="plugin_customization.ini"/>
</product>
and plugin_customization.ini file
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
2.add code in class ApplicationWorkbenchAdvisor
PlatformUI.getPreferenceStore().setValue( IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
but not work, What's the problem?
This preference is not used in Eclipse 4.3 (Kepler) because the styling is controlled by CSS.
To change the tab style you either define your own style or you can edit one of the existing css files (in the org.eclipse.platform plugin css directory).
The tab style is controlled by the swt-simple property, usually set for the .MPartStack class:
.MPartStack {
swt-simple: true;
.. other properties ...
}
true gives you the traditional tabs.
More information on css styling and creating styles here: http://www.vogella.com/articles/Eclipse4CSS/article.html
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!
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:
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