How can I configure the font size for the tree item in the package explorer in Eclipse?

前端 未结 23 781
孤城傲影
孤城傲影 2020-11-29 16:33

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?

相关标签:
23条回答
  • 2020-11-29 16:53

    On Windows 7, you can affect many of the Eclipse GUI fonts, including the Project Explorer by going to:

    Control Panel → PersonalizationWindow Color and AppearanceAdvanced 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...

    0 讨论(0)
  • 2020-11-29 16:55

    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.

    0 讨论(0)
  • 2020-11-29 16:55

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

    0 讨论(0)
  • 2020-11-29 16:56

    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.

    0 讨论(0)
  • 2020-11-29 16:58

    In Windows 8,

    1. go to Control Panel -> Appearance and Personalization -> Display
    2. In the middle of the screen there is a drop down under the heading Change Only the Text Size, select Message bokes.
    3. Change the font size in the adjacent drop down.
    0 讨论(0)
  • 2020-11-29 16:59

    Ubuntu, Eclipse v4.4 (Luna)*

    1. Locate your: eclipse/plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css
    2. Pick the CSS file that you are using per PreferencesGeneralAppearance inside the Eclipse UI.
    3. 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.

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