changeset 4145:b658b502b096

[gaim-migrate @ 4363] gtk1.2 code in anything except the buddy list window is a bug. this patch from David Brigada (jsi): " This patch changes the mechanism in which Gaim changes the colors on tabs for typing notification, new message notification, etc.. The previous mechanism was causing the font to change (possible mix of gtk1.2 and gtk2.0 code). Instead of loading the label's preferences with gtk_widget_get_modifier_style(), changing the color (with a -> edit), and then saving the label's preferences with gtk_widget_modify_style(), it changes the color with gtk_widget_modify_fg(). This fixes the font problem on my computer. The GTK 2.0 API docs seem to suggest the use of gtk_widget_modify_fg() over gtk_widget_modify_style() when necessary." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 26 Dec 2002 15:40:23 +0000
parents 168273c1cc77
children 06427e5560a4
files src/conversation.c
diffstat 1 files changed, 23 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Thu Dec 26 15:37:46 2002 +0000
+++ b/src/conversation.c	Thu Dec 26 15:40:23 2002 +0000
@@ -2657,7 +2657,7 @@
 void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data)
 {
 	GtkWidget *label = NULL;
-	GtkStyle *style;
+	GdkColor color;
 	struct conversation *c;
 	
 	if ((convo_options & OPT_CONVO_COMBINE) &&
@@ -2683,10 +2683,10 @@
 
 	if (!GTK_WIDGET_REALIZED(label))
 		return;
-	style = gtk_style_new();
-	gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style)));
-	gtk_widget_set_style(label, style);
-	gtk_style_unref(style);
+	color.red = 0x0000;
+	color.green = 0x0000;
+	color.blue = 0x0000;
+	gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &color);
 	if (c)
 		c->unseen = 0;
 
@@ -2720,32 +2720,31 @@
 		return;
 	debug_printf("update_convo_status called for %s\n", c->name);
 	if (im_options & OPT_IM_ONE_WINDOW) { /* We'll make the tab green */
-		GtkStyle *style;
 		GtkWidget *label = c->tab_label;
-		style = gtk_style_new();
-		if (!GTK_WIDGET_REALIZED(label))
-			gtk_widget_realize(label);
-		gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style)));
+		GdkColor color;
 		if(c->typing_state == TYPING) {
-			style->fg[0].red = 0x0000;
-			style->fg[0].green = 0x9999;
-			style->fg[0].blue = 0x0000;
+			color.red = 0x0000;
+			color.green = 0x9999;
+			color.blue = 0x0000;
 		} else if(c->typing_state == TYPED) {
-			style->fg[0].red = 0xffff;
-			style->fg[0].green = 0xbbbb;
-			style->fg[0].blue = 0x2222;
+			color.red = 0xffff;
+			color.green = 0xbbbb;
+			color.blue = 0x2222;
 		} else if(c->unseen == 2) {
-			style->fg[0].red = 0x0000;
-			style->fg[0].green = 0x0000;
-			style->fg[0].blue = 0xcccc;
+			color.red = 0x0000;
+			color.green = 0x0000;
+			color.blue = 0xcccc;
 		} else if(c->unseen == 1) {
-			style->fg[0].red = 0xcccc;
-			style->fg[0].green = 0x0000;
-			style->fg[0].blue = 0x0000;
+			color.red = 0xcccc;
+			color.green = 0x0000;
+			color.blue = 0x0000;
+		} else {
+			color.red = 0x0000;
+			color.green = 0x0000;
+			color.blue = 0x0000;
 		}
-		gtk_widget_set_style(label, style);
+		gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &color);
 			debug_printf("setting style\n");
-		gtk_style_unref(style);
 	} else {
 		GtkWindow *win = (GtkWindow *)c->window;
 		char *buf, *buf2;