Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2017-06-29 16:00:48 +0000
committerAlexander Kurtakov2017-06-29 18:27:02 +0000
commitf3589756b1057b01e3ae719bf8ba0464d3131ea5 (patch)
tree9b1588e3b5b1a8d4160918ef1e86796452a8e2f6 /bundles/org.eclipse.swt/Eclipse SWT Accessibility
parent4f872fd395164f725f4b93c20c939640f33f2146 (diff)
downloadeclipse.platform.swt-f3589756b1057b01e3ae719bf8ba0464d3131ea5.tar.gz
eclipse.platform.swt-f3589756b1057b01e3ae719bf8ba0464d3131ea5.tar.xz
eclipse.platform.swt-f3589756b1057b01e3ae719bf8ba0464d3131ea5.zip
Bug 477950: [GTK3] Port SWT colors from using GdkColor to GdkRGBA so
alpha is not lost Fix some cases where GdkColor/Color.handle was being invoked on GTK3. Change-Id: I356028b52f029415ebe8ade4821471cc4e567cc6 Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Accessibility')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
index 9778b0d492..7e3a32c795 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
@@ -2191,7 +2191,11 @@ class AccessibleObject {
if (color != null && !color.isDisposed()) {
long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_FG_COLOR));
- attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
+ if (OS.GTK3) {
+ attr.value = getStringPtr ((color.handleRGBA.red * 255) + "," + (color.handleRGBA.green * 255) + "," + (color.handleRGBA.blue * 255)); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
result = OS.g_slist_append(result, attrPtr);
}
@@ -2199,7 +2203,11 @@ class AccessibleObject {
if (color != null && !color.isDisposed()) {
long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_BG_COLOR));
- attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
+ if (OS.GTK3) {
+ attr.value = getStringPtr ((color.handleRGBA.red * 255) + "," + (color.handleRGBA.green * 255) + "," + (color.handleRGBA.blue * 255)); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
result = OS.g_slist_append(result, attrPtr);
}

Back to the top