diff options
author | Matthias Becker | 2019-04-11 08:03:12 +0000 |
---|---|---|
committer | Matthias Becker | 2019-04-23 12:57:13 +0000 |
commit | 334542aecfe5ad8883b94a07a4a93b1a4e50d383 (patch) | |
tree | cebd794541dc2766dc13491179f1329c3caa7950 | |
parent | 40dae1df9dcd3f3be49fe15daf33b2619b8c8234 (diff) | |
download | eclipse.platform.swt-334542aecfe5ad8883b94a07a4a93b1a4e50d383.tar.gz eclipse.platform.swt-334542aecfe5ad8883b94a07a4a93b1a4e50d383.tar.xz eclipse.platform.swt-334542aecfe5ad8883b94a07a4a93b1a4e50d383.zip |
Bug 466511: Replace dropdown menu custom drawing with png
View dropdown uses grey as foreground color so the min max icons
need to use the same color
Change-Id: If6d5b618658787ea0f83423c8c817e00fd359f0d
Signed-off-by: Matthias Becker <ma.becker@sap.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java index 2fa60dcea8..6be28cddda 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java @@ -51,6 +51,7 @@ public class CTabFolderRenderer { Color selectedOuterColor = null; Color selectedInnerColor = null; Color tabAreaColor = null; + Color minMaxBorderColor = null; /* * Border color that was used in computing the cached anti-alias Colors. * We have to recompute the colors if the border color changes @@ -549,6 +550,10 @@ public class CTabFolderRenderer { chevronFont.dispose(); chevronFont = null; } + if (minMaxBorderColor != null) { + minMaxBorderColor.dispose(); + minMaxBorderColor = null; + } } void disposeAntialiasColors() { @@ -600,6 +605,12 @@ public class CTabFolderRenderer { * @since 3.6 */ protected void draw (int part, int state, Rectangle bounds, GC gc) { + if (minMaxBorderColor == null) { + // this color has to be identical to the colors used in the PNG files of + // the view drop down menu located in + // org.eclipse.e4.ui.workbench.renderers.swt/icons/full/elcl16/view_menu.png + minMaxBorderColor = new Color (gc.getDevice(), 105, 105, 105); + } switch (part) { case PART_BACKGROUND: this.drawBackground(gc, bounds, state); @@ -1122,7 +1133,7 @@ public class CTabFolderRenderer { int x = maxRect.x + (maxRect.width - 10)/2; int y = maxRect.y + 3; - gc.setForeground(display.getSystemColor(BUTTON_BORDER)); + gc.setForeground(minMaxBorderColor); gc.setBackground(display.getSystemColor(BUTTON_FILL)); switch (maxImageState & (SWT.HOT | SWT.SELECTED)) { @@ -1182,7 +1193,7 @@ public class CTabFolderRenderer { int x = minRect.x + (minRect.width - 10)/2; int y = minRect.y + 3; - gc.setForeground(display.getSystemColor(BUTTON_BORDER)); + gc.setForeground(minMaxBorderColor); gc.setBackground(display.getSystemColor(BUTTON_FILL)); switch (minImageState & (SWT.HOT | SWT.SELECTED)) { |