From 64df2c666c7411b43f82ae299fca86c48719354a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Mar 2010 13:25:26 -0600 Subject: Setting up the callback for themes changing. --- libindicator/indicator-image-helper.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libindicator/indicator-image-helper.c b/libindicator/indicator-image-helper.c index 5897711..08a4875 100644 --- a/libindicator/indicator-image-helper.c +++ b/libindicator/indicator-image-helper.c @@ -3,7 +3,7 @@ const gchar * INDICATOR_NAMES_DATA = "indicator-names-data"; -void +static void refresh_image (GtkImage * image) { g_return_if_fail(GTK_IS_IMAGE(image)); @@ -43,6 +43,16 @@ refresh_image (GtkImage * image) return; } +/* Handles the theme changed signal to refresh the icon to make + sure that it changes appropriately */ +static void +theme_changed_cb (GtkIconTheme * theme, gpointer user_data) +{ + GtkImage * image = GTK_IMAGE(user_data); + refresh_image(image); + return; +} + GtkImage * indicator_image_helper (const gchar * name) { @@ -69,7 +79,7 @@ indicator_image_helper (const gchar * name) refresh_image(image); /* Connect to all changes */ - /* TODO */ + g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), "changed", G_CALLBACK(theme_changed_cb), image); /* Return our built image */ return image; -- cgit v1.2.3