diff options
author | Ted Gould <ted@gould.cx> | 2010-03-10 13:25:26 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-10 13:25:26 -0600 |
commit | 64df2c666c7411b43f82ae299fca86c48719354a (patch) | |
tree | 93a9b7404f8fbefdb968cc9b0a40564cf0ce87c3 /libindicator | |
parent | 805edb88641378614175ad9f4f205bbdc1d707a1 (diff) | |
download | libayatana-indicator-64df2c666c7411b43f82ae299fca86c48719354a.tar.gz libayatana-indicator-64df2c666c7411b43f82ae299fca86c48719354a.tar.bz2 libayatana-indicator-64df2c666c7411b43f82ae299fca86c48719354a.zip |
Setting up the callback for themes changing.
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-image-helper.c | 14 |
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; |