j321123j
j321123j

Reputation: 51

increase eclipse toolbar icon size

I am using Eclips on Ubuntu 20.04. I found that font and icons size are too small.

When I run

GDK_DPI_SCALE=1.1 ./eclipse

Font size are ok but toolbar icons are still retaining small size:

Small icons on toolbar

When I tries to edit e4_basestyle.css files under eclipse\plugins\org.eclipse.ui.themes_X.X.X.vXXXXXXXX-XXXX\css by adding

#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
    font-size: 16px;
    font: Nato Sans;
}

.MPart Tree {
    font-family: Nato Sans;
    font-size: 16px;
}

it only affect on font.

Any options?

Upvotes: 5

Views: 6454

Answers (3)

Francesco Galgani
Francesco Galgani

Reputation: 6249

A Linux-specific solution for Eclipse, tested with Eclipse 2024.12. It requires ImageMagick to be installed:

find ./eclipse/java-2024-12/eclipse -type f -iname '*.png' -exec sh -c '
  for f; do
    echo "Found file PNG: $f"
    echo "Creation of backup: $f.bak"
    cp "$f" "$f.bak"
    echo "Double the size of $f..."
    mogrify -resize 200% "$f"
    echo "Operation completed on $f"
  done
' sh {} +

No other proposed solution that I have found here or elsewhere works on Eclipse 2014.12 on Linux Mint 22.

It is conceptually similar to the solution proposed by Michael Hamilton, but in my installation there are no *2x.png icons. This script doubles the size of all icons.

Upvotes: 0

Michael Hamilton
Michael Hamilton

Reputation: 586

As mentioned by others, the existing switch -Dswt.autoScale=200 doesn't work on all platforms. Using autoScale may result in a broken eclipse UI. There is another way to increase the icon sizes without using the autoscale switch...

In the Eclipse IDE for C/C++ Developers 2023-09 (4.29.0), for every blah.png file under the eclipse/configuration/org.eclipse.osgi hierarchy, there is also corresponding [email protected] file which contains a larger version of the same icon.

I've read that SWT applications should automatically apply the @2X icons. I suspect the SWT code that detects High-DPI is broken for some platforms, the use of the 2x icons should be automatic, but doesn't always work.

I forced the use of the larger icons by using the following Linux commands to rename each [email protected] to blah.png (which overwrites the original).

find eclipse/cpp-2023-09/eclipse/configuration   -iname '*@2X.png' | awk '{nf=$1; sub("@2x", "", nf); print "mv", $1, nf;}' | bash

You can preview the command actions without actually doing them by omitting the pipe-to-bash | bash on the end of the command line.

After restarting eclipse the icons on the toolbar are doubled in size.

Upvotes: 4

Walter Jucá
Walter Jucá

Reputation: 51

Following this guy's answer; https://stackoverflow.com/a/61405677/13800339

At first, close eclipse and be sure it is closed. Than edit eclipse.ini and add the following lines:

-Dswt.enable.autoScale=true

-Dswt.autoScale=150

-Dswt.autoScale.method=nearest

The -Dswt.autoScale=150 will increase your Icons, 150 will say 150%. If it is not enough, increase it or decrease it otherwise.

Upvotes: 5

Related Questions