summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2002-05-02 16:11:33 +0000
committerGrant Gayed <ggayed>2002-05-02 16:11:33 +0000
commit2965e22087fd5869288d99654e6052a6c2332f69 (patch)
tree5efc8b2c61c853405e67b10b9d9225d09bee0567 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
parent7ac4db042657c0f8ba72e20813606b013279fdb1 (diff)
downloadeclipse.platform.swt-2965e22087fd5869288d99654e6052a6c2332f69.tar.gz
eclipse.platform.swt-2965e22087fd5869288d99654e6052a6c2332f69.tar.xz
eclipse.platform.swt-2965e22087fd5869288d99654e6052a6c2332f69.zip
to be reverted
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
index 4fb124db8a..4baaa63278 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
@@ -110,21 +110,19 @@ public RGB open () {
}
GtkColorSelectionDialog dialog = new GtkColorSelectionDialog ();
OS.memmove(dialog, handle);
- GdkColor color = new GdkColor();
if (rgb != null) {
- color.red = (short)((rgb.red & 0xFF) | ((rgb.red & 0xFF) << 8));
- color.green = (short)((rgb.green & 0xFF) | ((rgb.green & 0xFF) << 8));
- color.blue = (short)((rgb.blue & 0xFF) | ((rgb.blue & 0xFF) << 8));
- OS.gtk_color_selection_set_current_color (dialog.colorsel, color);
+ double [] color = new double [4];
+ color [0] = (double)rgb.red / 256;
+ color [1] = (double)rgb.green / 256;
+ color [2] = (double)rgb.blue / 256;
+ OS.gtk_color_selection_set_color (dialog.colorsel, color);
}
rgb = null;
int response = OS.gtk_dialog_run(handle);
if (response == OS.GTK_RESPONSE_OK) {
- OS.gtk_color_selection_get_current_color (dialog.colorsel, color);
- int red = (color.red >> 8) & 0xFF;
- int green = (color.green >> 8) & 0xFF;
- int blue = (color.blue >> 8) & 0xFF;
- rgb = new RGB (red, green, blue);
+ double [] color = new double [4];
+ OS.gtk_color_selection_get_color (dialog.colorsel, color);
+ rgb = new RGB ((int)(color [0] * 256), (int)(color [1] * 256), (int)(color [2] * 256));
}
OS.gtk_widget_destroy(handle);
return rgb;