Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2019-06-19 07:57:51 -0400
committerLakshmi Shanmugam2019-06-19 07:57:51 -0400
commit2470d69b4b084655198d367bf4e84c2b13bd397b (patch)
tree2e0f9b9eff93b71338a4a06ba5002602ba047f36
parent3af3c2ceec1fa14e27f28870cd2af72d64df76be (diff)
downloadeclipse.platform.swt-2470d69b4b084655198d367bf4e84c2b13bd397b.tar.gz
eclipse.platform.swt-2470d69b4b084655198d367bf4e84c2b13bd397b.tar.xz
eclipse.platform.swt-2470d69b4b084655198d367bf4e84c2b13bd397b.zip
Bug 548320: [Mac] Add color constants for disabled background and
foreground colors Initialize the new color constants. Update Snippet235. Change-Id: I898471760b16da6010d1aa124bb15d41641b57ad
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java9
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.java4
2 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 2ed0858d29..85d658609e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -1899,7 +1899,10 @@ double [] getWidgetColorRGB (int id) {
case SWT.COLOR_WIDGET_FOREGROUND: color = NSColor.controlTextColor(); break;
case SWT.COLOR_WIDGET_BORDER: color = NSColor.blackColor (); break;
case SWT.COLOR_LIST_FOREGROUND: color = NSColor.textColor(); break;
+
+ case SWT.COLOR_TEXT_DISABLED_BACKGROUND:
case SWT.COLOR_LIST_BACKGROUND: color = NSColor.textBackgroundColor(); break;
+
case SWT.COLOR_LIST_SELECTION_TEXT: color = NSColor.selectedTextColor(); break;
case SWT.COLOR_LIST_SELECTION: color = NSColor.selectedTextBackgroundColor(); break;
case SWT.COLOR_LINK_FOREGROUND:
@@ -1909,7 +1912,7 @@ double [] getWidgetColorRGB (int id) {
color = new NSColor(dict.valueForKey(OS.NSForegroundColorAttributeName));
textView.release ();
break;
-
+ case SWT.COLOR_WIDGET_DISABLED_FOREGROUND: color = NSColor.disabledControlTextColor(); break;
}
return getNSColorRGB (color);
}
@@ -3073,7 +3076,7 @@ void initColors (boolean ignoreColorChange) {
}
void initColors () {
- colors = new double [SWT.COLOR_LINK_FOREGROUND + 1][];
+ colors = new double [SWT.COLOR_WIDGET_DISABLED_FOREGROUND + 1][];
colors[SWT.COLOR_INFO_FOREGROUND] = getWidgetColorRGB(SWT.COLOR_INFO_FOREGROUND);
colors[SWT.COLOR_INFO_BACKGROUND] = getWidgetColorRGB(SWT.COLOR_INFO_BACKGROUND);
colors[SWT.COLOR_TITLE_FOREGROUND] = getWidgetColorRGB(SWT.COLOR_TITLE_FOREGROUND);
@@ -3094,6 +3097,8 @@ void initColors () {
colors[SWT.COLOR_LIST_SELECTION_TEXT] = getWidgetColorRGB(SWT.COLOR_LIST_SELECTION_TEXT);
colors[SWT.COLOR_LIST_SELECTION] = getWidgetColorRGB(SWT.COLOR_LIST_SELECTION);
colors[SWT.COLOR_LINK_FOREGROUND] = getWidgetColorRGB(SWT.COLOR_LINK_FOREGROUND);
+ colors[SWT.COLOR_TEXT_DISABLED_BACKGROUND] = getWidgetColorRGB(SWT.COLOR_TEXT_DISABLED_BACKGROUND);
+ colors[SWT.COLOR_WIDGET_DISABLED_FOREGROUND] = getWidgetColorRGB(SWT.COLOR_WIDGET_DISABLED_FOREGROUND);
alternateSelectedControlColor = getNSColorRGB(NSColor.alternateSelectedControlColor());
alternateSelectedControlTextColor = getNSColorRGB(NSColor.alternateSelectedControlTextColor());
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.java
index dc8fcd29df..a459cdd0c0 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.java
@@ -79,6 +79,7 @@ static int[] colorIds = new int[] {SWT.COLOR_INFO_BACKGROUND,
SWT.COLOR_LIST_FOREGROUND,
SWT.COLOR_LIST_SELECTION,
SWT.COLOR_LIST_SELECTION_TEXT,
+ SWT.COLOR_TEXT_DISABLED_BACKGROUND,
SWT.COLOR_TITLE_BACKGROUND,
SWT.COLOR_TITLE_BACKGROUND_GRADIENT,
SWT.COLOR_TITLE_FOREGROUND,
@@ -88,6 +89,7 @@ static int[] colorIds = new int[] {SWT.COLOR_INFO_BACKGROUND,
SWT.COLOR_WIDGET_BACKGROUND,
SWT.COLOR_WIDGET_BORDER,
SWT.COLOR_WIDGET_DARK_SHADOW,
+ SWT.COLOR_WIDGET_DISABLED_FOREGROUND,
SWT.COLOR_WIDGET_FOREGROUND,
SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW,
SWT.COLOR_WIDGET_LIGHT_SHADOW,
@@ -99,6 +101,7 @@ static String [] colorNames = new String[] {"SWT.COLOR_INFO_BACKGROUND",
"SWT.COLOR_LIST_FOREGROUND",
"SWT.COLOR_LIST_SELECTION",
"SWT.COLOR_LIST_SELECTION_TEXT",
+ "SWT.COLOR_TEXT_DISABLED_BACKGROUND",
"SWT.COLOR_TITLE_BACKGROUND",
"SWT.COLOR_TITLE_BACKGROUND_GRADIENT",
"SWT.COLOR_TITLE_FOREGROUND",
@@ -108,6 +111,7 @@ static String [] colorNames = new String[] {"SWT.COLOR_INFO_BACKGROUND",
"SWT.COLOR_WIDGET_BACKGROUND",
"SWT.COLOR_WIDGET_BORDER",
"SWT.COLOR_WIDGET_DARK_SHADOW",
+ "SWT.COLOR_WIDGET_DISABLED_FOREGROUND",
"SWT.COLOR_WIDGET_FOREGROUND",
"SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW",
"SWT.COLOR_WIDGET_LIGHT_SHADOW",

Back to the top