<handler
adapter="org.eclipse.e4.ui.css.swt.dom.CTabFolderElement"
composite="false"
+ handler="org.eclipse.e4.ui.css.swt.properties.custom.CSSPropertyUnselectHotTabsColorBackgroundHandler">
+ <property-name
+ name="unselected-hot-tab-color-background">
+ </property-name>
+ </handler>
+ <handler
+ adapter="org.eclipse.e4.ui.css.swt.dom.CTabFolderElement"
+ composite="false"
handler="org.eclipse.e4.ui.css.swt.properties.custom.CSSPropertyShadowColorHandler">
<property-name
name="swt-shadow-color">
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Fabio Zadrozny and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabio Zadrozny - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.css.swt.properties.custom;
+
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
+import org.eclipse.e4.ui.internal.css.swt.ICTabRendering;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabFolderRenderer;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Control;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSPropertyUnselectHotTabsColorBackgroundHandler extends AbstractCSSPropertySWTHandler {
+
+ public static final String UNSELECTED_HOT_TAB_COLOR_BACKGROUND = "unselected-hot-tab-color-background";
+
+ @Override
+ protected void applyCSSProperty(Control control, String property,
+ CSSValue value, String pseudo, CSSEngine engine) throws Exception {
+ if (UNSELECTED_HOT_TAB_COLOR_BACKGROUND.equals(property)) {
+ if (!(control instanceof CTabFolder)) {
+ return;
+ }
+ if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
+ Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay());
+ CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
+ if (renderer instanceof ICTabRendering) {
+ ((ICTabRendering) renderer).setUnselectedHotTabsColorBackground(newColor);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected String retrieveCSSProperty(Control control, String property,
+ String pseudo, CSSEngine engine) throws Exception {
+ return null;
+ }
+
+}
/*******************************************************************************
- * Copyright (c) 2014 IBM Corporation and others.
+ * Copyright (c) 2014-2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Fabio Zadrozny - Bug 465711
*******************************************************************************/
package org.eclipse.e4.ui.internal.css.swt;
void setUnselectedTabsColor(Color[] colors, int[] percents);
+ void setUnselectedHotTabsColorBackground(Color color);
+
void setTabOutline(Color color);
void setInnerKeyline(Color color);
/*******************************************************************************
- * Copyright (c) 2010, 2014 IBM Corporation and others.
+ * Copyright (c) 2010, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Fabio Zadrozny - Bug 465711
*******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
private CTabFolderRendererWrapper rendererWrapper;
private CTabFolderWrapper parentWrapper;
+ private Color hotUnselectedTabsColorBackground;
+
@Inject
public CTabRendering(CTabFolder parent) {
super(parent);
}
@Override
+ public void setUnselectedHotTabsColorBackground(Color color) {
+ this.hotUnselectedTabsColorBackground = color;
+ }
+
+ @Override
protected Rectangle computeTrim(int part, int state, int x, int y,
int width, int height) {
boolean onBottom = parent.getTabPosition() == SWT.BOTTOM;
+ INNER_KEYLINE + OUTER_KEYLINE), bounds.y
+ bounds.height);
- gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE));
+ Color color = hotUnselectedTabsColorBackground;
+ if (color == null) {
+ // Fallback: if color was not set, use white for highlighting
+ // hot tab.
+ color = gc.getDevice().getSystemColor(SWT.COLOR_WHITE);
+ }
+ gc.setBackground(color);
int[] tmpPoints = new int[index];
System.arraycopy(points, 0, tmpPoints, 0, index);
gc.fillPolygon(tmpPoints);
/*******************************************************************************
- * Copyright (c) 2010, 2014 Andrea Guarinoni and others.
+ * Copyright (c) 2010, 2015 Andrea Guarinoni and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* Stefan Winkler <stefan@winklerweb.net> - Bug 434189
* Stefan Winkler <stefan@winklerweb.net> - Bug 430848
* Simon Scholz <simon.scholz@vogella.com> - Bug 431635
- * Fabio Zadrozny <fabiofz@gmail.com> - Bug 465148
+ * Fabio Zadrozny <fabiofz@gmail.com> - Bug 465148, 465711
*******************************************************************************/
/*******************************************************************************
swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END'; /* title background for selected tab */
swt-shadow-visible: false;
swt-corner-radius: 16px;
+ unselected-hot-tab-color-background: #161616; /* Bug 465711 */
}
CTabFolder[style~='SWT.DOWN'][style~='SWT.BOTTOM'] {
/* Set the styles for the bottom inner tabs (Bug 430051): */
swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
+ unselected-hot-tab-color-background: #161616; /* Bug 465711 */
}
Form,