From 379db3d78312b3159693d8c98a1b6ee0805702d1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 26 Feb 2010 14:19:06 +0000 Subject: update the not-favorite icon when the theme is changed --- libempathy-gtk/empathy-presence-chooser.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index ee92829fc..7c4aae9ba 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -825,6 +825,20 @@ create_not_favorite_pixbuf (void) return result; } +static void +icon_theme_changed_cb (GtkIconTheme *icon_theme, + EmpathyPresenceChooser *self) +{ + EmpathyPresenceChooserPriv *priv = GET_PRIV (self); + + /* Theme has changed, recreate the not-favorite icon */ + g_object_unref (priv->not_favorite_pixbuf); + priv->not_favorite_pixbuf = create_not_favorite_pixbuf (); + + /* Update the icon */ + presence_chooser_set_favorite_icon (self); +} + static void empathy_presence_chooser_init (EmpathyPresenceChooser *chooser) { @@ -839,6 +853,10 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser) priv->not_favorite_pixbuf = create_not_favorite_pixbuf (); g_assert (priv->not_favorite_pixbuf != NULL); + empathy_signal_connect_weak (gtk_icon_theme_get_default (), "changed", + G_CALLBACK (icon_theme_changed_cb), + G_OBJECT (chooser)); + presence_chooser_create_model (chooser); gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (chooser), -- cgit v1.2.3