soc.2008.themes: 989c8380: Added layout capabilities to blist theme...

ffdragon at soc.pidgin.im ffdragon at soc.pidgin.im
Mon Jul 21 23:10:44 EDT 2008


-----------------------------------------------------------------
Revision: 989c8380f568f017c3e60290f1e30121222b514c
Ancestor: 5b1d9544761ba8cb275d69dc9d19045c61f93c09
Author: ffdragon at soc.pidgin.im
Date: 2008-07-22T03:08:59
Branch: im.pidgin.soc.2008.themes
URL: http://d.pidgin.im/viewmtn/revision/info/989c8380f568f017c3e60290f1e30121222b514c

Modified files:
        pidgin/gtkblist-loader.c pidgin/gtkblist-theme.h
        pidgin/gtkblist.c

ChangeLog: 

Added layout capabilities to blist themes

-------------- next part --------------
============================================================
--- pidgin/gtkblist-loader.c	79f8eb800ed068eea44fad44402dc08303ac3873
+++ pidgin/gtkblist-loader.c	2917489361cbcd6aa6d373e356a8e0067f32ee8b
@@ -31,6 +31,7 @@
 /******************************************************************************
  * Globals
  *****************************************************************************/
+#define DEFAULT_TEXT_COLOR "black"
 /*****************************************************************************
  * Buddy List Theme Builder                                                      
  *****************************************************************************/
@@ -43,9 +44,10 @@ pidgin_blist_loader_build(const gchar *d
 	const gchar *icon_theme = NULL, *tmp;
 	gboolean sucess = TRUE;
 	GdkColor *bgcolor, *expanded_bgcolor, *collapsed_bgcolor, *buddy_bgcolor1, *buddy_bgcolor2;
+	GdkColor color;
 	FontColorPair *expanded, *collapsed, *online, *away, *offline, *message, *status;
 	gdouble transparency;
-	PidginBlistLayout *layout = g_new0(PidginBlistLayout, 1);
+	PidginBlistLayout *layout;
 	GDir *gdir;
 	PidginBlistTheme *theme;
 
@@ -67,28 +69,22 @@ pidgin_blist_loader_build(const gchar *d
 	root_node = xmlnode_from_file(dir, filename, "blist themes", "blist-loader");
 	g_return_val_if_fail(root_node != NULL, NULL);
 
-	/* colors */
+	/* init all structs and colors */
 	bgcolor = g_new0(GdkColor, 1);
 	expanded_bgcolor = g_new0(GdkColor, 1);
 	collapsed_bgcolor = g_new0(GdkColor, 1); 
 	buddy_bgcolor1 = g_new0(GdkColor, 1);
 	buddy_bgcolor2 = g_new0(GdkColor, 1);
-	
-	/* font color pairs */
+
+	layout = g_new0(PidginBlistLayout, 1);
+
 	expanded = g_new0(FontColorPair, 1);
-	expanded->color = g_new0(GdkColor, 1);
 	collapsed = g_new0(FontColorPair, 1);
-	collapsed->color = g_new0(GdkColor, 1);
 	online = g_new0(FontColorPair, 1);
-	online->color = g_new0(GdkColor, 1);
 	away = g_new0(FontColorPair, 1);
-	away->color = g_new0(GdkColor, 1);
 	offline = g_new0(FontColorPair, 1);
-	offline->color = g_new0(GdkColor, 1); 
-	message = g_new0(FontColorPair, 1);
-	message->color = g_new0(GdkColor, 1); 
+	message = g_new0(FontColorPair, 1); 
 	status = g_new0(FontColorPair, 1);
-	status->color = g_new0(GdkColor, 1);
 
 	/* Parse the tree */	
 	sub_node = xmlnode_get_child(root_node, "description");
@@ -116,12 +112,9 @@ pidgin_blist_loader_build(const gchar *d
 
 		expanded->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
 
-		if ((tmp = xmlnode_get_attrib(sub_sub_node, "color")) != NULL && gdk_color_parse(tmp, expanded->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), expanded->color, FALSE, TRUE);
-		else {
-			g_free(expanded->color);
-			expanded->color = NULL;
-		}
+		if ((tmp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(tmp, &color))
+			expanded->color = g_strdup(tmp);
+		else expanded->color = DEFAULT_TEXT_COLOR;
 	
 
 		if ((tmp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(tmp, expanded_bgcolor))
@@ -135,12 +128,10 @@ pidgin_blist_loader_build(const gchar *d
 	if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "collapsed")) != NULL)) {
 		collapsed->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
 
-		if((tmp = xmlnode_get_attrib(sub_sub_node, "color")) != NULL && gdk_color_parse(tmp, collapsed->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), collapsed->color, FALSE, TRUE);
-		else {
-			g_free(collapsed->color);
-			collapsed->color = NULL;
-		}
+		if((tmp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(tmp, &color))
+			collapsed->color = g_strdup(tmp);
+		else collapsed->color = DEFAULT_TEXT_COLOR;
+
 		if ((tmp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(tmp, collapsed_bgcolor))
 			gdk_colormap_alloc_color(gdk_colormap_get_system(), collapsed_bgcolor, FALSE, TRUE);
 		else {
@@ -153,11 +144,11 @@ pidgin_blist_loader_build(const gchar *d
 	if ((sucess = sucess && (sub_node = xmlnode_get_child(root_node, "buddys")) != NULL &&
 		     (sub_sub_node = xmlnode_get_child(sub_node, "placement")) != NULL)) { 
 
-		layout->buddy_icon = atoi(xmlnode_get_attrib(sub_sub_node, "status_icon"));
+		layout->status_icon = atoi(xmlnode_get_attrib(sub_sub_node, "status_icon"));
 		layout->text = atoi(xmlnode_get_attrib(sub_sub_node, "name"));
-		layout->buddy_icon = atoi(xmlnode_get_attrib(sub_sub_node, "buddy_icon"));
+		layout->emblem = atoi(xmlnode_get_attrib(sub_sub_node, "emblem"));
 		layout->protocol_icon = atoi(xmlnode_get_attrib(sub_sub_node, "protocol_icon"));
-		layout->emblem = atoi(xmlnode_get_attrib(sub_sub_node, "emblem"));
+		layout->buddy_icon = atoi(xmlnode_get_attrib(sub_sub_node, "buddy_icon"));		
 		layout->show_status = atoi(xmlnode_get_attrib(sub_sub_node, "status_icon")) != 0;
 	}
 
@@ -180,52 +171,37 @@ pidgin_blist_loader_build(const gchar *d
 
 	if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "online_text")) != NULL)) {
 		online->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
-		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), online->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), online->color, FALSE, TRUE);
-		else {
-			g_free(online->color);
-			online->color = NULL;
-		}
+		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &color))
+			online->color = g_strdup(tmp);
+		else online->color = DEFAULT_TEXT_COLOR;
 	}
 
 	if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "away_text")) != NULL)) {
 		away->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
-		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), away->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), away->color, FALSE, TRUE);
-		else {
-			g_free(away->color);
-			away->color = NULL;
-		}
+		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &color))
+			away->color = g_strdup(tmp);
+		else away->color = DEFAULT_TEXT_COLOR;
 	}
 
 	if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "offline_text")) != NULL)) {
 		offline->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
-		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), offline->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), offline->color, FALSE, TRUE);
-		else {
-			g_free(offline->color);
-			online->color = NULL;
-		}
+		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &color))
+			online->color = g_strdup(tmp);
+		else online->color = DEFAULT_TEXT_COLOR;
 	}
 	
 	if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_text")) != NULL)) {
 		message->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
-		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), message->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), message->color, FALSE, TRUE);
-		else {
-			g_free(message->color);
-			message->color = NULL;
-		}
+		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &color))
+			message->color = g_strdup(tmp);
+		else message->color = DEFAULT_TEXT_COLOR;
 	}
 	
 	if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "status_text")) != NULL)) {
 		status->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font"));
-		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), status->color))
-			gdk_colormap_alloc_color(gdk_colormap_get_system(), status->color, FALSE, TRUE);
-		else {
-			g_free(status->color);
-			status->color = NULL;
-		}
+		if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &color))
+			status->color = g_strdup(tmp);
+		else status->color = DEFAULT_TEXT_COLOR;
 	}
 
 	/* name is required for theme manager */
============================================================
--- pidgin/gtkblist-theme.h	852974c3153b38067ba154260e41d8617df99be7
+++ pidgin/gtkblist-theme.h	8f2001b9368771b87df37565a39e8110cf61eb06
@@ -63,17 +63,17 @@ typedef struct
 typedef struct
 {
 	gchar *font;
-	GdkColor *color;
+	gchar *color;
 
 } FontColorPair;
 
 typedef struct
 {
-	gint buddy_icon;
+	gint status_icon;
 	gint text;
-	gint status_icon;
+	gint emblem;
 	gint protocol_icon;
-	gint emblem;
+	gint buddy_icon;
 	gboolean show_status; 
 
 } PidginBlistLayout;
============================================================
--- pidgin/gtkblist.c	56ba37b64b247e79a5a3e845b621ab72996f418f
+++ pidgin/gtkblist.c	96d5558d84ace577b3c583dabe81046f90d2c3c1
@@ -127,6 +127,7 @@ typedef struct
 	PidginMiniDialog *signed_on_elsewhere;
 
 	PidginBlistTheme *current_theme;
+
 } PidginBuddyListPrivate;
 
 #define PIDGIN_BUDDY_LIST_GET_PRIVATE(list) \
@@ -5231,11 +5232,148 @@ kiosk_page()
 }
 #endif
 
+/* builds the blist layout according to to the current theme */
+static void
+pidgin_blist_build_layout(PurpleBuddyList *list)
+{
+	GtkTreeViewColumn *column;
+	PidginBlistLayout *layout;
+	PidginBlistTheme *theme;
+	GtkCellRenderer *rend;
+	gint i;
+
+	column = gtkblist->text_column;
+
+	if ((theme = pidgin_blist_get_theme()) != NULL)
+		layout = pidgin_blist_theme_get_layout(theme);
+	else {
+		/* Default Layout */
+		layout = g_new0(PidginBlistLayout, 1);
+
+		layout->status_icon = 0;				
+		layout->text = 1;
+		layout->emblem = 2;
+		layout->protocol_icon = 3;
+		layout->buddy_icon = 4;
+		layout->show_status = 5; 
+	}
+
+	gtk_tree_view_column_clear(column);
+
+	/* group */
+	rend = pidgin_cell_renderer_expander_new();
+	gtk_tree_view_column_pack_start(column, rend, FALSE);
+	gtk_tree_view_column_set_attributes(column, rend,
+					    "visible", GROUP_EXPANDER_VISIBLE_COLUMN,
+					    "expander-visible", GROUP_EXPANDER_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+					    "sensitive", GROUP_EXPANDER_COLUMN,
+					    "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+					    NULL);
+
+	/* contact */
+	rend = pidgin_cell_renderer_expander_new();
+	gtk_tree_view_column_pack_start(column, rend, FALSE);
+	gtk_tree_view_column_set_attributes(column, rend,
+					    "expander-visible", CONTACT_EXPANDER_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+					    "sensitive", CONTACT_EXPANDER_COLUMN,
+					    "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+					    "visible", CONTACT_EXPANDER_VISIBLE_COLUMN,
+					    NULL);
+
+	for (i = 0; i < 5; i++) {
+
+		if (layout->status_icon == i) {		
+			/* status icons */
+			rend = gtk_cell_renderer_pixbuf_new();
+			gtk_tree_view_column_pack_start(column, rend, FALSE);
+			gtk_tree_view_column_set_attributes(column, rend,
+							    "pixbuf", STATUS_ICON_COLUMN,
+							    "visible", STATUS_ICON_VISIBLE_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+							    "cell-background-gdk", BGCOLOR_COLUMN,
+#endif	
+							    NULL);
+			g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL);
+
+		} else if (layout->text == i) {
+			/* name */
+			gtkblist->text_rend = rend = gtk_cell_renderer_text_new();
+			gtk_tree_view_column_pack_start (column, rend, TRUE);
+			gtk_tree_view_column_set_attributes(column, rend,
+#if GTK_CHECK_VERSION(2,6,0)
+							    "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+							    "markup", NAME_COLUMN,
+							    NULL);
+#if GTK_CHECK_VERSION(2,6,0)
+			g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL);
+			g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list);
+#endif
+			g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list);
+			g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
+#if GTK_CHECK_VERSION(2,6,0)
+			g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+#endif
+
+			/* idle */
+			rend = gtk_cell_renderer_text_new();
+			g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
+			gtk_tree_view_column_pack_start(column, rend, FALSE);
+			gtk_tree_view_column_set_attributes(column, rend,
+							    "markup", IDLE_COLUMN,
+							    "visible", IDLE_VISIBLE_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+							    "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+							    NULL);
+		} else if (layout->emblem == i) {
+			/* emblem */
+			rend = gtk_cell_renderer_pixbuf_new();
+			g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL);
+			gtk_tree_view_column_pack_start(column, rend, FALSE);
+			gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+									  "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+									  "visible", EMBLEM_VISIBLE_COLUMN, NULL);
+
+		} else if (layout->protocol_icon == i) {
+			/* protocol icon */
+			rend = gtk_cell_renderer_pixbuf_new();
+			gtk_tree_view_column_pack_start(column, rend, FALSE);
+			gtk_tree_view_column_set_attributes(column, rend,
+							   "pixbuf", PROTOCOL_ICON_COLUMN,
+							   "visible", PROTOCOL_ICON_VISIBLE_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+							   "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+							  NULL);
+			g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL);
+
+		} else if (layout->buddy_icon == i) {
+			/* buddy icon */
+			rend = gtk_cell_renderer_pixbuf_new();
+			g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
+			gtk_tree_view_column_pack_start(column, rend, FALSE);
+			gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN,
+#if GTK_CHECK_VERSION(2,6,0)
+							    "cell-background-gdk", BGCOLOR_COLUMN,
+#endif
+							    "visible", BUDDY_ICON_VISIBLE_COLUMN,
+							    NULL);
+		}
+
+	}/* end for loop */
+}
+
 static void pidgin_blist_show(PurpleBuddyList *list)
 {
 	PidginBuddyListPrivate *priv;
 	void *handle;
-	GtkCellRenderer *rend;
 	GtkTreeViewColumn *column;
 	GtkWidget *menu;
 	GtkWidget *ebox;
@@ -5446,115 +5584,17 @@ static void pidgin_blist_show(PurpleBudd
 
 	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gtkblist->treeview), FALSE);
 
-	/* columns */
+	/* expander columns */
 	column = gtk_tree_view_column_new();
 	gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column);
 	gtk_tree_view_column_set_visible(column, FALSE);
 	gtk_tree_view_set_expander_column(GTK_TREE_VIEW(gtkblist->treeview), column);
 
-	/* group */
-	gtkblist->text_column = column = gtk_tree_view_column_new ();
-	rend = pidgin_cell_renderer_expander_new();
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					    "visible", GROUP_EXPANDER_VISIBLE_COLUMN,
-					    "expander-visible", GROUP_EXPANDER_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-					    "sensitive", GROUP_EXPANDER_COLUMN,
-					    "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					    NULL);
+	/* everything else column */
+	gtkblist->text_column = gtk_tree_view_column_new ();
+	gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), gtkblist->text_column);
+	pidgin_blist_build_layout(list);
 
-	/* contact */
-	rend = pidgin_cell_renderer_expander_new();
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					    "expander-visible", CONTACT_EXPANDER_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-					    "sensitive", CONTACT_EXPANDER_COLUMN,
-					    "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					    "visible", CONTACT_EXPANDER_VISIBLE_COLUMN,
-					    NULL);
-
-	/* status icons */
-	rend = gtk_cell_renderer_pixbuf_new();
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					    "pixbuf", STATUS_ICON_COLUMN,
-					    "visible", STATUS_ICON_VISIBLE_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-					    "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					    NULL);
-	g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL);
-
-	/* name */
-	gtkblist->text_rend = rend = gtk_cell_renderer_text_new();
-	gtk_tree_view_column_pack_start (column, rend, TRUE);
-	gtk_tree_view_column_set_attributes(column, rend,
-#if GTK_CHECK_VERSION(2,6,0)
-					    "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					    "markup", NAME_COLUMN,
-					    NULL);
-#if GTK_CHECK_VERSION(2,6,0)
-	g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL);
-	g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list);
-#endif
-	g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list);
-	g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
-#if GTK_CHECK_VERSION(2,6,0)
-	g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-#endif
-	gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column);
-
-	/* idle */
-	rend = gtk_cell_renderer_text_new();
-	g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					    "markup", IDLE_COLUMN,
-					    "visible", IDLE_VISIBLE_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-					    "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					    NULL);
-
-	/* emblem */
-	rend = gtk_cell_renderer_pixbuf_new();
-	g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL);
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-							  "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-							  "visible", EMBLEM_VISIBLE_COLUMN, NULL);
-
-	/* protocol icon */
-	rend = gtk_cell_renderer_pixbuf_new();
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					   "pixbuf", PROTOCOL_ICON_COLUMN,
-					   "visible", PROTOCOL_ICON_VISIBLE_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-					   "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					  NULL);
-	g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL);
-
-	/* buddy icon */
-	rend = gtk_cell_renderer_pixbuf_new();
-	g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN,
-#if GTK_CHECK_VERSION(2,6,0)
-					    "cell-background-gdk", BGCOLOR_COLUMN,
-#endif
-					    "visible", BUDDY_ICON_VISIBLE_COLUMN,
-					    NULL);
-
-
 	g_signal_connect(G_OBJECT(gtkblist->treeview), "row-activated", G_CALLBACK(gtk_blist_row_activated_cb), NULL);
 	g_signal_connect(G_OBJECT(gtkblist->treeview), "row-expanded", G_CALLBACK(gtk_blist_row_expanded_cb), NULL);
 	g_signal_connect(G_OBJECT(gtkblist->treeview), "row-collapsed", G_CALLBACK(gtk_blist_row_collapsed_cb), NULL);
@@ -6034,6 +6074,9 @@ static char *pidgin_get_group_title(Purp
 	char *mark, *esc;
 	PurpleBlistNode *selected_node = NULL;
 	GtkTreeIter iter;
+	FontColorPair *pair;
+	PidginBlistTheme *theme;
+	const gchar *text_color, *text_font;
 
 	group = (PurpleGroup*)gnode;
 
@@ -6048,9 +6091,25 @@ static char *pidgin_get_group_title(Purp
 		           purple_blist_get_group_online_count(group),
 		           purple_blist_get_group_size(group, FALSE));
 	}
+	
+	theme = pidgin_blist_get_theme();
+	if (theme == NULL) {
+		text_color = "black";
+		text_font = "";
+	} else if (expanded) {
+		pair = pidgin_blist_theme_get_expanded_text_info(theme);
+		text_color = pair->color;
+		text_font = pair->font;
+	}else {
+		pair = pidgin_blist_theme_get_collapsed_text_info(theme);
+		text_color = pair->color;
+		text_font = pair->font;
+	}
+		
 
 	esc = g_markup_escape_text(group->name, -1);
-	mark = g_strdup_printf("<span weight='bold'>%s</span>%s", esc ? esc : "", group_count);
+	mark = g_strdup_printf("<span foreground='%s' font_desc='%s'><span weight='bold'>%s</span>%s</span>",
+							text_color, text_font, esc ? esc : "", group_count);
 
 	g_free(esc);
 	return mark;
@@ -7187,6 +7246,7 @@ pidgin_blist_set_theme(PidginBlistTheme 
 pidgin_blist_set_theme(PidginBlistTheme *theme)
 {
 	PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
+	PurpleBuddyList *list = purple_get_blist();
 
 	if (theme != NULL)
 		purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/theme", 
@@ -7195,7 +7255,9 @@ pidgin_blist_set_theme(PidginBlistTheme 
 
 	priv->current_theme = theme;
 
-	pidgin_blist_refresh(purple_get_blist());
+	pidgin_blist_build_layout(list);
+
+	pidgin_blist_refresh(list);
 }
 
 


More information about the Commits mailing list