[empathy] update the not-favorite icon when the theme is changed
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] update the not-favorite icon when the theme is changed
- Date: Sat, 27 Feb 2010 18:53:33 +0000 (UTC)
commit 379db3d78312b3159693d8c98a1b6ee0805702d1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Feb 26 14:19:06 2010 +0000
update the not-favorite icon when the theme is changed
libempathy-gtk/empathy-presence-chooser.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index ee92829..7c4aae9 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -826,6 +826,20 @@ create_not_favorite_pixbuf (void)
}
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)
{
EmpathyPresenceChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (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),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]