aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-11 14:22:51 -0600
committerTed Gould <ted@gould.cx>2010-03-11 14:22:51 -0600
commit8caf60a3944a876075f173b520c53272003ebbe4 (patch)
tree383699d46a012fe984beac14ea23c0db29d082e2
parent5ca699baae839672ca9a418ab2f9c063dfdf9ae0 (diff)
parentbb8b7032dfd93cd0cdad55967b973dd4de7ca044 (diff)
downloadlibayatana-indicator-8caf60a3944a876075f173b520c53272003ebbe4.tar.gz
libayatana-indicator-8caf60a3944a876075f173b520c53272003ebbe4.tar.bz2
libayatana-indicator-8caf60a3944a876075f173b520c53272003ebbe4.zip
Upstream release 0.3.5
-rw-r--r--configure.ac4
-rw-r--r--debian/changelog15
-rw-r--r--libindicator/indicator-image-helper.c49
-rw-r--r--libindicator/indicator-image-helper.h4
4 files changed, 43 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac
index 2601ea5..b3f3d78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,10 @@
-AC_INIT(libindicator, 0.3.4, ted@canonical.com)
+AC_INIT(libindicator, 0.3.5, ted@canonical.com)
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libindicator, 0.3.4)
+AM_INIT_AUTOMAKE(libindicator, 0.3.5)
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
diff --git a/debian/changelog b/debian/changelog
index cfa43ce..bbb6996 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,18 +1,11 @@
-libindicator (0.3.4-0ubuntu1) lucid; urgency=low
-
- * Upstream Release 0.3.4
- * Reducing gio-unix dependency to 2.22
+libindicator (0.3.5-0ubuntu1~ppa1) UNRELEASED; urgency=low
- -- Ted Gould <ted@ubuntu.com> Thu, 25 Feb 2010 11:27:18 -0600
-
-libindicator (0.3.4-0ubuntu1~ppa2) lucid; urgency=low
-
- * Upstream merge
+ * Upstream release 0.3.5
* Adding in a image loader helper for indicators.
- -- Ted Gould <ted@ubuntu.com> Wed, 10 Mar 2010 22:12:32 -0600
+ -- Ted Gould <ted@ubuntu.com> Thu, 11 Mar 2010 14:22:09 -0600
-libindicator (0.3.4-0ubuntu1~ppa1) lucid; urgency=low
+libindicator (0.3.4-0ubuntu1) lucid; urgency=low
* Upstream Release 0.3.4
* Reducing gio-unix dependency to 2.22
diff --git a/libindicator/indicator-image-helper.c b/libindicator/indicator-image-helper.c
index cbbad3d..86d6c25 100644
--- a/libindicator/indicator-image-helper.c
+++ b/libindicator/indicator-image-helper.c
@@ -109,24 +109,41 @@ image_destroyed_cb (GtkImage * image, gpointer user_data)
return;
}
+/* Catch the style changing on the image to make sure
+ we've got the latest. */
+static void
+image_style_change_cb (GtkImage * image, GtkStyle * previous_style, gpointer user_data)
+{
+ refresh_image(image);
+ return;
+}
+
+/* Builds an image with the name and fallbacks and all kinds of fun
+ stuff . */
GtkImage *
indicator_image_helper (const gchar * name)
{
- g_return_val_if_fail(name != NULL, NULL);
- g_return_val_if_fail(name[0] != '\0', NULL);
+ /* Build us an image */
+ GtkImage * image = GTK_IMAGE(gtk_image_new());
+
+ indicator_image_helper_update(image, name);
+
+ return image;
+}
+
+/* Updates and image with all the fun stuff */
+void
+indicator_image_helper_update (GtkImage * image, const gchar * name)
+{
+ g_return_if_fail(name != NULL);
+ g_return_if_fail(name[0] != '\0');
+ g_return_if_fail(image != NULL);
/* Build us a GIcon */
GIcon * icon_names = g_themed_icon_new_with_default_fallbacks(name);
- g_return_val_if_fail(icon_names != NULL, NULL);
-
- /* Build us an image */
- GtkImage * image = GTK_IMAGE(gtk_image_new());
+ g_return_if_fail(icon_names != NULL);
- if (image == NULL) {
- g_error("Unable to create image from pixbuf on icon name '%s'", name);
- g_object_unref(icon_names);
- return NULL;
- }
+ gboolean seen_previously = (g_object_get_data(G_OBJECT(image), INDICATOR_NAMES_DATA) != NULL);
/* Attach our names to the image */
g_object_set_data_full(G_OBJECT(image), INDICATOR_NAMES_DATA, icon_names, g_object_unref);
@@ -135,9 +152,11 @@ indicator_image_helper (const gchar * name)
refresh_image(image);
/* Connect to all changes */
- g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), "changed", G_CALLBACK(theme_changed_cb), image);
- g_signal_connect(G_OBJECT(image), "destroy", G_CALLBACK(image_destroyed_cb), NULL);
+ if (!seen_previously) {
+ g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), "changed", G_CALLBACK(theme_changed_cb), image);
+ g_signal_connect(G_OBJECT(image), "destroy", G_CALLBACK(image_destroyed_cb), NULL);
+ g_signal_connect(G_OBJECT(image), "style-set", G_CALLBACK(image_style_change_cb), NULL);
+ }
- /* Return our built image */
- return image;
+ return;
}
diff --git a/libindicator/indicator-image-helper.h b/libindicator/indicator-image-helper.h
index fed02dc..77e2f0a 100644
--- a/libindicator/indicator-image-helper.h
+++ b/libindicator/indicator-image-helper.h
@@ -26,6 +26,8 @@ License along with this library. If not, see
#include <gtk/gtk.h>
-GtkImage * indicator_image_helper (const gchar * name);
+GtkImage * indicator_image_helper (const gchar * name);
+void indicator_image_helper_update (GtkImage * image,
+ const gchar * name);
#endif /* __INDICATOR_IMAGE_HELPER_H__ */