Update of /cvsroot/gaim/gaim/src
In directory usw-pr-cvs1:/tmp/cvs-serv22677/src
Modified Files:
dialogs.c
Log Message:
color selector works now.
Index: dialogs.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v
retrieving revision 1.342
retrieving revision 1.343
diff -u -d -r1.342 -r1.343
--- dialogs.c 26 Sep 2002 15:23:33 -0000 1.342
+++ dialogs.c 26 Sep 2002 21:03:06 -0000 1.343
@@ -3025,22 +3025,21 @@
void do_fgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
{
- gdouble color[3];
GdkColor text_color;
struct conversation *c;
char *open_tag;
open_tag = g_malloc(30);
- gtk_color_selection_get_color(colorsel, color);
+ gtk_color_selection_get_current_color(colorsel, &text_color);
c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
/* GTK_IS_EDITABLE(c->entry); huh? */
- text_color.red = ((guint16)(color[0] * 65535)) >> 8;
- text_color.green = ((guint16)(color[1] * 65535)) >> 8;
- text_color.blue = ((guint16)(color[2] * 65535)) >> 8;
-
+ text_color.red = text_color.red * 256 / 65535;
+ text_color.green = text_color.green * 256 /65535;
+ text_color.blue = text_color.blue * 256 / 65535;
+
c->fgcol = text_color;
c->hasfg = 1;
g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green,
@@ -3053,21 +3052,20 @@
void do_bgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
{
- gdouble color[3];
GdkColor text_color;
struct conversation *c;
char *open_tag;
open_tag = g_malloc(30);
- gtk_color_selection_get_color(colorsel, color);
+ gtk_color_selection_get_current_color(colorsel, &text_color);
c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
/* GTK_IS_EDITABLE(c->entry); huh? */
- text_color.red = ((guint16)(color[0] * 65535)) >> 8;
- text_color.green = ((guint16)(color[1] * 65535)) >> 8;
- text_color.blue = ((guint16)(color[2] * 65535)) >> 8;
+ text_color.red = text_color.red * 256 / 65535;
+ text_color.green = text_color.green * 256 /65535;
+ text_color.blue = text_color.blue * 256 / 65535;
c->bgcol = text_color;
c->hasbg = 1;
|