]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-presence-chooser.c
update the not-favorite icon when the theme is changed
[empathy.git] / libempathy-gtk / empathy-presence-chooser.c
index ee92829fcd7e7c82ee0828db0a318fdc530f16ab..7c4aae9bafa6f9fbf2e590f2a14f9adaa8dc0d1c 100644 (file)
@@ -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),