I cannot change the font size of package explorer in Eclipse

后端 未结 11 1021
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 01:25

I try to change the font size of package explorer in Eclipse from menu WindowPreferencesGeneralAppearance, and I fail to change

相关标签:
11条回答
  • 2020-11-30 01:43

    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).

    0 讨论(0)
  • 2020-11-30 01:44

    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 WindowsPreferenceGeneralAppearance.

    0 讨论(0)
  • 2020-11-30 01:46

    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;
        }
    

    Eclipse screenshot

    0 讨论(0)
  • 2020-11-30 01:47

    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)

    0 讨论(0)
  • 2020-11-30 01:52

    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).

    0 讨论(0)
  • 2020-11-30 01:57

    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.

    0 讨论(0)
提交回复
热议问题