changeset 4421:31834b4598eb

[gaim-migrate @ 4694] (23:26:06) deryni: Black on Black is not the best color choice this should let you use custom colors again. thanks deryni! committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 26 Jan 2003 04:27:14 +0000
parents 64d845f2a0fb
children 2fd80799d8f4
files src/dialogs.c src/gtkconv.c src/gtkconv.h src/prefs.c
diffstat 4 files changed, 30 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Sun Jan 26 04:23:20 2003 +0000
+++ b/src/dialogs.c	Sun Jan 26 04:27:14 2003 +0000
@@ -3125,7 +3125,6 @@
 	gtkconv = GAIM_GTK_CONVERSATION(c);
 
 	gtkconv->fg_color = text_color;
-	gtkconv->has_fg = TRUE;
 	g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">",
 			   text_color.red / 256,
 			   text_color.green / 256,
@@ -3156,7 +3155,6 @@
 	gtkconv = GAIM_GTK_CONVERSATION(c);
 
 	gtkconv->bg_color = text_color;
-	gtkconv->has_bg = TRUE;
 	g_snprintf(open_tag, 25, "<BODY BGCOLOR=\"#%02X%02X%02X\">",
 			   text_color.red / 256,
 			   text_color.green / 256,
--- a/src/gtkconv.c	Sun Jan 26 04:23:20 2003 +0000
+++ b/src/gtkconv.c	Sun Jan 26 04:27:14 2003 +0000
@@ -418,7 +418,7 @@
 			strcpy(buf, buf2);
 		}
 
-		if ((font_options & OPT_FONT_FGCOL) || gtkconv->has_fg) {
+		if (font_options & OPT_FONT_FGCOL) {
 			g_snprintf(buf2, limit,
 					   "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>",
 					   gtkconv->fg_color.red   / 256,
@@ -427,12 +427,12 @@
 			strcpy(buf, buf2);
 		}
 
-		if ((font_options & OPT_FONT_BGCOL) || gtkconv->has_bg) {
+		if (font_options & OPT_FONT_BGCOL) {
 			g_snprintf(buf2, limit,
 					   "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>",
-					   gtkconv->fg_color.red   / 256,
-					   gtkconv->fg_color.green / 256,
-					   gtkconv->fg_color.blue  / 256, buf);
+					   gtkconv->bg_color.red   / 256,
+					   gtkconv->bg_color.green / 256,
+					   gtkconv->bg_color.blue  / 256, buf);
 			strcpy(buf, buf2);
 		}
 	}
@@ -3301,6 +3301,9 @@
 		gtkconv->sg       = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 		gtkconv->tooltips = gtk_tooltips_new();
 
+		/* Setup the foreground and background colors */
+		gaim_gtkconv_update_font_colors(conv);
+
 		if (conv_type == GAIM_CONV_CHAT) {
 			gtkconv->u.chat = g_malloc0(sizeof(struct gaim_gtk_chat_pane));
 
@@ -4597,6 +4600,21 @@
 }
 
 void
+gaim_gtkconv_update_font_colors(struct gaim_conversation *conv)
+{
+	struct gaim_gtk_conversation *gtkconv = GAIM_GTK_CONVERSATION(conv);
+	
+		gtkconv->fg_color.red = fgcolor.red;
+		gtkconv->fg_color.blue = fgcolor.blue;
+		gtkconv->fg_color.green = fgcolor.green;
+
+		gtkconv->bg_color.red = bgcolor.red;
+		gtkconv->bg_color.blue = bgcolor.blue;
+		gtkconv->bg_color.green = bgcolor.green;
+
+}
+
+void
 gaim_gtkconv_update_tabs(void)
 {
 	GList *l;
--- a/src/gtkconv.h	Sun Jan 26 04:23:20 2003 +0000
+++ b/src/gtkconv.h	Sun Jan 26 04:27:14 2003 +0000
@@ -107,8 +107,6 @@
 {
 	gboolean make_sound;
 	gboolean has_font;
-	gboolean has_fg;
-	gboolean has_bg;
 	char fontface[128];
 	GdkColor fg_color;
 	GdkColor bg_color;
@@ -253,6 +251,12 @@
 void gaim_gtkconv_update_font_buttons(void);
 
 /**
+ * Updates the font colors of each conversation to the new colors
+ * chosen in the prefs dialog.
+ */
+void gaim_gtkconv_update_font_colors(struct gaim_conversation *conv);
+
+/**
  * Updates the tab positions on all conversation windows to reflect any
  * changed preferences.
  */
--- a/src/prefs.c	Sun Jan 26 04:23:20 2003 +0000
+++ b/src/prefs.c	Sun Jan 26 04:27:14 2003 +0000
@@ -2069,6 +2069,7 @@
 		destroy_colorsel(NULL, (void *)0);
 		update_color(NULL, pref_bg_picture);
 	}
+	gaim_conversation_foreach(gaim_gtkconv_update_font_colors);
 }
 
 void update_color(GtkWidget *w, GtkWidget *pic)