Eclipse: large toolbar icons

前端 未结 7 1340
忘掉有多难
忘掉有多难 2021-01-04 07:30

Does anybody know how to use large toolbar icons? Edit: How do I do it?

7条回答
  •  抹茶落季
    2021-01-04 08:06

    Running Eclipse 2020-09 R (i.e, v4.17) on Linux (openSUSE Tumbleweed with XFCE session) on an HP Spectre x360 with 283 dpi, I found that out of the box the fonts were fine but the icons were unreadably tiny. Also, setting -Dswt.autoscale=300 in the eclipse.ini made the icons look perfect but completely disrupted the layout and functionality of SWT (couldn't click on tabs, many texts were unreadably clipped). So I had to resort to the method of scaling all of the icon files. Here's one way to automate it.

    After running eclipse for the first time (since that first run unpacks a lot of icons), go to the top-level eclipse directory (the one in which the eclipse executable resides), and enter xonsh (the python-based shell) in that directory. Then you can execute the following commands (at your own risk), for example by copy-pasting them at the prompt:

    pngl = $(find . -name "*.png").strip().split("\n")
    for png in pngl: 
         if not ('@2x' in png): 
             print(f"Found icon {png}, moving...") 
             pngo = png.replace('.png','-orig.png') 
             mv @(png) @(pngo) 
             pngbig = png.replace('.png','@2x.png') 
             if pngbig in pngl: 
                 print("  ...has enlarged, scaling that by 150") 
                 convert @(pngbig) -resize 150% @(png) 
             else: 
                 print("  ...no enlargement, scaling orig by 300") 
                 convert @(pngo) -resize 300% @(png)
    

    Of course if you wanted a different basic scaling factor, say 250%, you would change the 150% scaling of the double size icon in the pngbig branch to 125% and the 300% scaling of the original-size icons in the other branch to 250%.

提交回复
热议问题