changeset 29616:0d613fa75e5f

Maintain ABI compatibility by keeping headline_close a GdkPixbuf. Seperate commit for easy disapproval when 3.0.0 comes around. Refs #8727.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 20 Mar 2010 06:17:13 +0000
parents 97005a2e99d7
children 7ed0ddbdd2a8
files pidgin/gtkblist.c pidgin/gtkblist.h
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Sat Mar 20 06:02:11 2010 +0000
+++ b/pidgin/gtkblist.c	Sat Mar 20 06:17:13 2010 +0000
@@ -5904,17 +5904,19 @@
 			  NULL);
 	gtk_widget_set_name(gtkblist->headline_hbox, "gtk-tooltips");
 
+	gtkblist->headline_close = gtk_widget_render_icon(ebox, GTK_STOCK_CLOSE,
+		gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC), NULL);
 	gtkblist->hand_cursor = gdk_cursor_new (GDK_HAND2);
 	gtkblist->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR);
 
 	/* Close button. */
 	close = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
-	gtkblist->headline_close = pidgin_create_small_button(close);
-	gtk_box_pack_start(GTK_BOX(gtkblist->headline_hbox), gtkblist->headline_close, FALSE, FALSE, 0);
+	close = pidgin_create_small_button(close);
+	gtk_box_pack_start(GTK_BOX(gtkblist->headline_hbox), close, FALSE, FALSE, 0);
 #if GTK_CHECK_VERSION(2,12,0)
-	gtk_widget_set_tooltip_text(gtkblist->headline_close, _("Close"));
+	gtk_widget_set_tooltip_text(close, _("Close"));
 #endif
-	g_signal_connect(gtkblist->headline_close, "clicked", G_CALLBACK(headline_close_press_cb), gtkblist);
+	g_signal_connect(close, "clicked", G_CALLBACK(headline_close_press_cb), gtkblist);
 
 	g_signal_connect(G_OBJECT(ebox), "enter-notify-event", G_CALLBACK(headline_box_enter_cb), gtkblist);
 	g_signal_connect(G_OBJECT(ebox), "leave-notify-event", G_CALLBACK(headline_box_leave_cb), gtkblist);
@@ -6919,6 +6921,9 @@
 
 	purple_signals_disconnect_by_handle(gtkblist);
 
+	if (gtkblist->headline_close)
+		gdk_pixbuf_unref(gtkblist->headline_close);
+
 	gtk_widget_destroy(gtkblist->window);
 
 	pidgin_blist_tooltip_destroy();
--- a/pidgin/gtkblist.h	Sat Mar 20 06:02:11 2010 +0000
+++ b/pidgin/gtkblist.h	Sat Mar 20 06:17:13 2010 +0000
@@ -119,7 +119,7 @@
 	GtkWidget *headline_hbox;       /**< Hbox for headline notification */
 	GtkWidget *headline_label;	/**< Label for headline notifications */
 	GtkWidget *headline_image;      /**< Image for headline notifications */
-	GtkWidget *headline_close;      /**< Button for closing the headline without triggering the callback */
+	GdkPixbuf *headline_close;      /**< @deprecated: Close image for closing the headline without triggering the callback */ 
 	GCallback headline_callback;    /**< Callback for headline notifications */
 	gpointer headline_data;         /**< User data for headline notifications */
 	GDestroyNotify headline_destroy; /**< Callback to use for destroying the headline-data */