Very large tabs in Eclipse panes on Ubuntu

后端 未结 7 1927
情歌与酒
情歌与酒 2020-12-12 09:38

My question is very similar to Stack Overflow question Gigantic Tabs in Eclipse on Ubuntu.

I have tried the solutions presented, but they appear to be old.

相关标签:
7条回答
  • 2020-12-12 10:07

    You can edit all small details about tab size here:

    0 讨论(0)
  • 2020-12-12 10:19

    Style of tabs can be changed in Eclipse 4.2 by editing CSS. You can change styles directly in Eclipse Preferences window after installing the E4 CSS editor plug-in.

    Go to menu Help > Install new software, then install E4 CSS editor (Incubation) plug-in using Eclipse 4 update site (add this link: http://download.eclipse.org/e4/updates/0.12).

    After restart, go to Window > Preferences, General > Appearance and now you can edit styles here for any selected theme.

    I am using this style for tabs:

    .MPartStack {
      font-size: 9;
      font-family: Liberation Sans;
      swt-tab-renderer: null;
      swt-tab-height: 22px;
      swt-selected-tabs-background: #FFFFFF #ECE9D8 100%;
      swt-simple: false;
      swt-mru-visible: false;
    }
    

    You can specify tabs height using the swt-tab-height option. It's value sets tab height ignoring the font size.

    0 讨论(0)
  • 2020-12-12 10:20

    Eclipse is now (4.5 Mars) defaulting to GTK3 on Linux. For 4.6 a fix seems to be alredy merged.

    Changing SWT_GTK3 environment variable works for Eclipse Mars:

    $ export SWT_GTK3=0
    

    or set that variable inline with running eclipse

    $ SWT_GTK3=0 /path/to/eclipse/eclipse
    

    To kill it dead just drop this in the root as eclipse.sh:

    #!/bin/bash
    SWT_GTK3=0 exec env "${0%.sh}"
    
    0 讨论(0)
  • 2020-12-12 10:23

    I also wanted to reduce especially the horizontal space in order to fit more tabs, as Eclipse lacks multi-row tabs.

    These instructions will go for any platform (not limited to e.g. Ubuntu/GTK).

    What I did was:

    • Reduced the font size
    • Changed font to something horizontal-compact
    • Removed the X (close tab) button

    ...yielding the following result on my system (Win 7):

    Screenshot with modified tabs

    ...and this is how it's done:

    1. Check what CSS layout you're using: Preferences->General->Appearance-> check value of 'Theme:' listbox

    2. Open the corresponding file in <eclipse folder>\plugins\org.eclipse.platform_<your version>\css, e.g. e4_default_win7.css

    3. Modify .MPartStack entries to set font size and font, e.g.:

      .MPartStack {
          font-size: 8;
          font-family: 'Arial Narrow';
          swt-simple: true;
          swt-mru-visible: false;
      }
      
    4. Add the following entry to remove the X (close icon):

      CTabItem {
          swt-show-close: false !important;   
      }
      

    That's it!

    0 讨论(0)
  • 2020-12-12 10:24

    You may try the theme from https://github.com/jeeeyul/eclipse-themes.

    After install this theme, apply it by choosing the theme in Window > Preferences > General > Appearence > Jeeeyul's themes.

    And to solve the large tab problem, please refer to https://github.com/jeeeyul/eclipse-themes/wiki/Linux-Huge-Toolbar-Problem.

    It's easy and beatiful. Enjoy it!

    0 讨论(0)
  • 2020-12-12 10:27

    You can edit Eclipse's CSS instead of messing with the GTK theme.

    In your Eclipse directory find the file plugins/org.eclipse.platform_4.2.*/css/e4_default_gtk.css (there's an * in there, because I guess that the version may change in the future or may be different already). In this file there's a CSS class:

    .MPartStack {
        font-size: 11;
        swt-simple: false;
        swt-mru-visible: false;
    }
    

    And you have two possible solutions:

    1. change font-size to something smaller
    2. just comment out or remove font-size from this class (works well for me)

    And that should do the trick.

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