aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-10 13:25:26 -0600
committerTed Gould <ted@gould.cx>2010-03-10 13:25:26 -0600
commit64df2c666c7411b43f82ae299fca86c48719354a (patch)
tree93a9b7404f8fbefdb968cc9b0a40564cf0ce87c3
parent805edb88641378614175ad9f4f205bbdc1d707a1 (diff)
downloadlibayatana-indicator-64df2c666c7411b43f82ae299fca86c48719354a.tar.gz
libayatana-indicator-64df2c666c7411b43f82ae299fca86c48719354a.tar.bz2
libayatana-indicator-64df2c666c7411b43f82ae299fca86c48719354a.zip
Setting up the callback for themes changing.
-rw-r--r--libindicator/indicator-image-helper.c14
1 files 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;