Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Becker2019-04-11 04:03:12 -0400
committerEric Williams2019-04-12 09:10:24 -0400
commita5d8b38bcb1b0702f9e164aacfd92f5edc1df87b (patch)
tree546c78a5c7e5251c0ec274e69a2f5bce744e2c8a
parent89d6547ac4be96fb55fcfc0b3291fd425ec2b298 (diff)
downloadeclipse.platform.swt-a5d8b38bcb1b0702f9e164aacfd92f5edc1df87b.tar.gz
eclipse.platform.swt-a5d8b38bcb1b0702f9e164aacfd92f5edc1df87b.tar.xz
eclipse.platform.swt-a5d8b38bcb1b0702f9e164aacfd92f5edc1df87b.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: I4a0c16f8a61faf4ac7d98deb35123d02a4e5ffeb 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.java15
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..a4e66d1cea 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(), 170, 170, 170);
+ }
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)) {

Back to the top