Mercurial > pidgin.yaz
changeset 5671:d43a00b81d2a
[gaim-migrate @ 6088]
color conversion and setting now works correctly. now maybe my eyes will
stop bleeding.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 02 Jun 2003 17:04:46 +0000 |
parents | f67742956a28 |
children | 5c5678c7b900 |
files | src/gaimrc.c src/gtkprefs.c |
diffstat | 2 files changed, 9 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- 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])) {
--- 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);