Question

Actually I am noticing that, the Tabs of Eclipse is too large on my Linux box.

So I've created simple app based on the code from http://www.mkyong.com/swt/swt-tabfolder-example/ but the tabs is very neat actually!

I am not a SWT guy, so I need to know what SWT components does Eclipse uses in its Tabs? and if they are the same in the example in the link, why it appears so big and ugly?

The following screenshot shows the Eclipse tab vs the Tabs of the TabFolder (from previous link)

enter image description here

Was it helpful?

Solution

The Eclipse folders are just done with CTabFolder. In Eclipse Kepler a custom renderer is used to support some of the CSS styling.

The curved edge is shown because CTabFolder.setSimple(false) has been called.

The area with the icons in it is not part of the tab, it is the view toolbar. It has been placed below the tab because the view is not wide enough to put the icons on the same line. If you increase the width of the view the icons will move to the same line:

Single line view tab

Update:

Some of the spacing is due to the custom tab renderer org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering which uses the following fixed margins:

static final int ITEM_TOP_MARGIN = 2;
static final int ITEM_BOTTOM_MARGIN = 6;
static final int ITEM_LEFT_MARGIN = 4;
static final int ITEM_RIGHT_MARGIN = 4;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top