Bug 434134 - [CSS] Active part's 2nd line toolbar background color looks
wrong
Change-Id: I4f758a76e817ac4f8a47263946b40a498357510a
Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
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 e54a4f9..8976c73 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
@@ -27,10 +27,7 @@
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Region;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.ToolBar;
@SuppressWarnings("restriction")
public class CTabRendering extends CTabFolderRenderer implements
@@ -60,8 +57,6 @@
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$
- private static final String TOOLBAR_CONTAINER = "CTabRendering.toolbarContainer"; //$NON-NLS-1$
-
int[] shape;
Image shadowImage, toolbarActiveImage, toolbarInactiveImage;
@@ -1114,54 +1109,6 @@
partHeaderBounds.height - 1, partHeaderBounds.width,
parent.getBounds().height, defaultBackground, colors, percents,
vertical);
-
- int selectedItemWidth = parent.getBounds().width;
- if (parent.getSelectionIndex() > -1) {
- Control control = parent.getSelection().getControl();
- if (control != null)
- selectedItemWidth = control.getBounds().width;
- }
-
- int leftRightBorder = (parent.getBounds().width - selectedItemWidth) / 2;
- int topBorder = INNER_KEYLINE + OUTER_KEYLINE;
- Control toolbarContainer = findToolbarContainer();
-
- if (toolbarContainer != null) {
- if (toolbarContainer.getBounds().height > 0) {
- int unselectedHeightToDraw = Math.max(
- toolbarContainer.getBounds().height,
- partHeaderBounds.height);
-
- rendererWrapper.drawBackground(gc, partHeaderBounds.x
- + leftRightBorder, partHeaderBounds.height + topBorder,
- partHeaderBounds.width - leftRightBorder * 2,
- unselectedHeightToDraw, defaultBackground,
- getUnselectedTabsColors(state),
- getUnselectedTabsPercents(state), vertical);
- }
- }
- }
-
- private Control findToolbarContainer() {
- Object obj = parent.getData(TOOLBAR_CONTAINER);
- if (obj instanceof Control) {
- Control control = (Control) obj;
- if (!control.isDisposed()) {
- return control;
- }
- }
-
- for (Control child : parent.getChildren()) {
- if (child instanceof Composite) {
- for (Control subChild : ((Composite) child).getChildren()) {
- if (subChild instanceof ToolBar && subChild.isVisible()) {
- parent.setData(TOOLBAR_CONTAINER, child);
- return child;
- }
- }
- }
- }
- return null;
}
private static class CTabFolderRendererWrapper extends
diff --git a/bundles/org.eclipse.ui.themes/css/dark/e4-dark_partstyle.css b/bundles/org.eclipse.ui.themes/css/dark/e4-dark_partstyle.css
index f142c57..240cdc0 100644
--- a/bundles/org.eclipse.ui.themes/css/dark/e4-dark_partstyle.css
+++ b/bundles/org.eclipse.ui.themes/css/dark/e4-dark_partstyle.css
@@ -315,23 +315,3 @@
background-color: #252525;
color: #CCCCCC;
}
-
-/* begin of the hack for the Bug 433276 */
-.MPartStack#left > Composite,
-.MPartStack#left ToolBar,
-.MPartStack#right > Composite,
-.MPartStack#right ToolBar,
-.MPartStack#bottom > Composite,
-.MPartStack#bottom ToolBar {
- background-color: '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%;
-}
-
-.MPartStack#left.active > Composite,
-.MPartStack#left.active ToolBar,
-.MPartStack#right.active > Composite,
-.MPartStack#right.active ToolBar,
-.MPartStack#bottom.active > Composite,
-.MPartStack#bottom.active ToolBar {
- background-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%;
-}
-/* end of the hack */
diff --git a/bundles/org.eclipse.ui.themes/css/e4_basestyle.css b/bundles/org.eclipse.ui.themes/css/e4_basestyle.css
index 14d0a45..f1e7da8 100644
--- a/bundles/org.eclipse.ui.themes/css/e4_basestyle.css
+++ b/bundles/org.eclipse.ui.themes/css/e4_basestyle.css
@@ -174,16 +174,6 @@
background-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END';
}
-/* begin of the hack for the Bug 433276 */
-.MPartStack#left > Composite, .MPartStack#right > Composite, .MPartStack#bottom > Composite {
- background-color: '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%;
-}
-
-.MPartStack#left.active > Composite, .MPartStack#right.active > Composite, .MPartStack#bottom.active > Composite {
- background-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%;
-}
-/* end of the hack */
-
#PerspectiveSwitcher {
eclipse-perspective-keyline-color: #AAB0BF #AAB0BF;
}