# HG changeset patch # User Nathan Walp # Date 1054573486 0 # Node ID d43a00b81d2a09e467300af74a143c5462c5c74f # Parent f67742956a28ad854db525b6e17a62f8c8b25831 [gaim-migrate @ 6088] color conversion and setting now works correctly. now maybe my eyes will stop bleeding. committer: Tailor Script diff -r f67742956a28 -r d43a00b81d2a src/gaimrc.c --- a/src/gaimrc.c Mon Jun 02 14:41:22 2003 +0000 +++ b/src/gaimrc.c Mon Jun 02 17:04:46 2003 +0000 @@ -191,9 +191,6 @@ * was loaded from the file * or otherwise explicitly requested */ -static GdkColor fgcolor; -static GdkColor bgcolor; - struct parse { char option[256]; char value[MAX_VALUES][4096]; @@ -929,33 +926,18 @@ } else if (!strcmp(p->option, "font_size")) { gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0])); } else if (!strcmp(p->option, "foreground")) { - char buf[8]; + char buf[14]; - /*this is totally counter intuitive. why would you read in 2 before 1? - *because gaim 0.6x stored it badly, and to get the intended color - *we have to read it in equally oddly. - * --luke - */ - - fgcolor.red = atoi(p->value[0]); - fgcolor.blue = atoi(p->value[2]); - fgcolor.green = atoi(p->value[1]); - - g_snprintf(buf, sizeof(buf), "#%03x%03x%03x", - atoi(p->value[0]), atoi(p->value[2]), atoi(p->value[1])); + g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", + atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2])); gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); } else if (!strcmp(p->option, "background")) { - char buf[8]; + char buf[14]; - bgcolor.red = atoi(p->value[0]); - bgcolor.blue = atoi(p->value[2]); - bgcolor.green = atoi(p->value[1]); - - g_snprintf(buf, sizeof(buf), "#%03x%03x%03x", - atoi(p->value[0]), atoi(p->value[2]), atoi(p->value[1])); + g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", + atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2])); gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); - printf("\n\n%s\n\n",buf); } else if (!strcmp(p->option, "report_idle")) { switch(atoi(p->value[0])) { diff -r f67742956a28 -r d43a00b81d2a src/gtkprefs.c --- a/src/gtkprefs.c Mon Jun 02 14:41:22 2003 +0000 +++ b/src/gtkprefs.c Mon Jun 02 17:04:46 2003 +0000 @@ -2544,7 +2544,7 @@ void apply_color_dlg(GtkWidget *w, gpointer d) { - char buf[8]; + char buf[14]; if ((int)d == 1) { GdkColor fgcolor; @@ -2553,7 +2553,7 @@ (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), &fgcolor); - g_snprintf(buf, sizeof(buf), "#%02x%02x%02x", + g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", fgcolor.red, fgcolor.green, fgcolor.blue); gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); @@ -2567,7 +2567,7 @@ (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), &bgcolor); - g_snprintf(buf, sizeof(buf), "#%02x%02x%02x", + g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", bgcolor.red, bgcolor.green, bgcolor.blue); gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf);