How can I configure the font size for the tree item in the package explorer/outline in Eclipse?
Which item in Font under Preferences I should change?
On Windows 7, you can affect many of the Eclipse GUI fonts, including the Project Explorer by going to:
Control Panel → Personalization → Window Color and Appearance → Advanced Appearance Settings
Change the font size for "Message Box".
Of course this messes with the appearance of other stuff in your OS, but I've found that tolerable compared to squinting at the project explorer...
Go into eclipse/plugins/org.eclipse.ui.themes_1.1.0.v{HERE_SOME_DIGITS}\css
.
Here you see your installed theme CSS files. Choose you theme, and add at the end of file (for example, e4_default_win7.css
):
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
font: Consolas; /* <-- Font you want to have */
}
It was tested with Eclipse v4.4 (Luna) and Eclipse v4.5 (Mars) on Windows 7.
For Mac users:
In file:
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css
Find this code snippet:
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION']
[style~='SWT.DATE'] > Composite > * > Tree {
background-color: #2F2F2F;
color: #CCC;
}
Modify it adding information about the font size:
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION']
[style~='SWT.DATE'] > Composite > * > Tree {
background-color: #2F2F2F;
color: #CCC;
font-size: 13;
}
This example is for the Dark theme in Eclipse v4.4 (Luna).
On Windows 10, if you got hit by the Creators Update:
The Windows 10 Creators Update apparently removed the ability to "Change only the text size" in "Display settings". In addition the update reset my previous text size setting so that I ended up with small font size in the tree items of the package explorer.
A solution that worked for me is to use a small tool 'A+ System Font Size Changer'. There, increasing the "Message box" setting to 4 (a custom unit defined by the tool) and applying the setting changed the font size in the items of the package explorer.
The tool also allows you to increase the size of "Menu", "Title bar", "Palette title", "Icon" (which worked wonders on the display of folders in windows explorer), and "Tooltip".
P.S.: I would have preferred to comment on the answer from Hartmut, but my reputation score is too low.
In Windows 8,
Change Only the Text Size
, select Message bokes
.eclipse/plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css
Backup the original and add something like the following, after first closing Eclipse just for safety:
.MPart Tree { font-size: 14; }
*It was performed on ScalaIDE version of Eclipse v4.4 (Luna) and should be the same for regular Eclipse v4.4 (Luna), I think.