diff options
| author | Mike Marchand | 2020-04-15 20:53:24 +0000 |
|---|---|---|
| committer | Lars Vogel | 2020-04-16 06:46:43 +0000 |
| commit | 40500009cce062f9a81533e94f1e310fdc9f76de (patch) | |
| tree | 9eee08475f6a2e0983e68f05a1b3df3fa59eb835 | |
| parent | 5a0d9a62223ed910937d297c951211e2433c4007 (diff) | |
| download | eclipse.platform.ui-40500009cce062f9a81533e94f1e310fdc9f76de.tar.gz eclipse.platform.ui-40500009cce062f9a81533e94f1e310fdc9f76de.tar.xz eclipse.platform.ui-40500009cce062f9a81533e94f1e310fdc9f76de.zip | |
Bug 562183 - Don't use cornerSize in CTabRendering.computeTrim account
for tab outline in trim. Adjust topPadding in css since it is no longer
artificially created by using cornerSize in computeTrim.
Change-Id: I27e3dee4f66894d62ec0920e3926561ad110fe0f
Signed-off-by: Mike Marchand <mmarchand@cranksoftware.com>
| -rw-r--r-- | bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java | 31 | ||||
| -rw-r--r-- | bundles/org.eclipse.ui.themes/css/dark/e4-dark_tabstyle.css | 4 |
2 files changed, 19 insertions, 16 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java index 9b40e7bcf49..aa2033e6455 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java @@ -71,12 +71,14 @@ public class CTabRendering extends CTabFolderRenderer implements ICTabRendering static final int INNER_KEYLINE = 0; static final int TOP_KEYLINE = 0; + // The tab has an outline, it contributes to the trim. See Bug 562183. + static final int TAB_OUTLINE = 1; + // Item Constants 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; - static final int INTERNAL_SPACING = 4; static final String E4_TOOLBAR_ACTIVE_IMAGE = "org.eclipse.e4.renderer.toolbar_background_active_image"; //$NON-NLS-1$ static final String E4_TOOLBAR_INACTIVE_IMAGE = "org.eclipse.e4.renderer.toolbar_background_inactive_image"; //$NON-NLS-1$ @@ -125,20 +127,21 @@ public class CTabRendering extends CTabFolderRenderer implements ICTabRendering int marginWidth = parent.marginWidth; int marginHeight = parent.marginHeight; int sideDropWidth = shadowEnabled ? SIDE_DROP_WIDTH : 0; + + //Trim is not affected by the corner size. switch (part) { case PART_BODY: if (state == SWT.FILL) { x = -1 - paddingLeft; int tabHeight = parent.getTabHeight() + 1; - y = onBottom ? y - paddingTop - marginHeight - borderTop - (cornerSize / 4) - : y - paddingTop - marginHeight - tabHeight - borderTop - (cornerSize / 4); + y = onBottom ? y - paddingTop - marginHeight - borderTop - TAB_OUTLINE + : y - paddingTop - marginHeight - tabHeight - borderTop - TAB_OUTLINE; width = 2 + paddingLeft + paddingRight; - height += paddingTop + paddingBottom; - height += tabHeight + (cornerSize / 4) + borderBottom + borderTop; + height += paddingTop + paddingBottom + TAB_OUTLINE; + height += tabHeight + borderBottom + borderTop; } else { - x = x - marginWidth - OUTER_KEYLINE - INNER_KEYLINE - sideDropWidth - (cornerSize / 2); - width = width + 2 * OUTER_KEYLINE + 2 * INNER_KEYLINE + 2 * marginWidth + 2 * sideDropWidth - + cornerSize; + x = x - marginWidth - OUTER_KEYLINE - INNER_KEYLINE - sideDropWidth; + width = width + 2 * OUTER_KEYLINE + 2 * INNER_KEYLINE + 2 * marginWidth + 2 * sideDropWidth; int tabHeight = parent.getTabHeight() + 1; // TODO: Figure out // what // to do about the @@ -153,10 +156,10 @@ public class CTabRendering extends CTabFolderRenderer implements ICTabRendering // - borderTop: y - marginHeight - highlight_header - // tabHeight // - borderTop; - y = onBottom ? y - marginHeight - borderTop - (cornerSize / 4) - : y - marginHeight - tabHeight - borderTop - (cornerSize / 4); - height = height + borderBottom + borderTop + 2 * marginHeight + tabHeight + cornerSize / 2 - + cornerSize / 4 + (shadowEnabled ? BOTTOM_DROP_WIDTH : 0); + y = onBottom ? y - marginHeight - borderTop + : y - marginHeight - tabHeight - borderTop - TAB_OUTLINE; + height = height + borderBottom + borderTop + 2 * marginHeight + tabHeight + TAB_OUTLINE + + (shadowEnabled ? BOTTOM_DROP_WIDTH : 0); } } break; @@ -165,8 +168,8 @@ public class CTabRendering extends CTabFolderRenderer implements ICTabRendering width = width + 2 * (INNER_KEYLINE + OUTER_KEYLINE + sideDropWidth); break; case PART_BORDER: - x = x - INNER_KEYLINE - OUTER_KEYLINE - sideDropWidth - (cornerSize / 4); - width = width + 2 * (INNER_KEYLINE + OUTER_KEYLINE + sideDropWidth) + cornerSize / 2; + x = x - INNER_KEYLINE - OUTER_KEYLINE - sideDropWidth; + width = width + 2 * (INNER_KEYLINE + OUTER_KEYLINE + sideDropWidth); height += borderTop + borderBottom; y -= borderTop; if (onBottom) { diff --git a/bundles/org.eclipse.ui.themes/css/dark/e4-dark_tabstyle.css b/bundles/org.eclipse.ui.themes/css/dark/e4-dark_tabstyle.css index adc7ce159b4..6f2d702f9fa 100644 --- a/bundles/org.eclipse.ui.themes/css/dark/e4-dark_tabstyle.css +++ b/bundles/org.eclipse.ui.themes/css/dark/e4-dark_tabstyle.css @@ -23,7 +23,7 @@ .MPartStack { font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT'; swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering'); - padding: 0px 2px 2px; + padding: 2px 2px; swt-shadow-visible: false; swt-mru-visible: true; swt-corner-radius: 16px; @@ -33,7 +33,7 @@ CTabFolder { /* Set the styles for the inner tabs: */ color: '#org-eclipse-ui-workbench-INACTIVE_TAB_TEXT_COLOR'; swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering'); - padding: 0px 2px 2px; + padding: 2px 2px; swt-tab-outline: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR'; /* border color for selected tab */ swt-outer-keyline-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR'; /* border color for whole tabs container */ swt-unselected-tabs-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%; /* title background for unselected tab */ |
