← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/indicator-messages/app-item-icon-refresh into lp:indicator-messages

 

Ted Gould has proposed merging lp:~ted/indicator-messages/app-item-icon-refresh into lp:indicator-messages.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)


Allow the icons to refresh as well.  This catches cases were we haven't
gotten the icon name yet.
-- 
https://code.launchpad.net/~ted/indicator-messages/app-item-icon-refresh/+merge/22083
Your team ayatana-commits is subscribed to branch lp:indicator-messages.
=== modified file 'src/indicator-messages.c'
--- src/indicator-messages.c	2010-03-23 21:22:26 +0000
+++ src/indicator-messages.c	2010-03-24 22:20:33 +0000
@@ -207,6 +207,20 @@
 	return FALSE;
 }
 
+/* Sets the icon when it changes. */
+static void
+application_icon_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, gpointer user_data)
+{
+	if (!g_strcmp0(prop, APPLICATION_MENUITEM_PROP_ICON)) {
+		/* Set the main icon */
+		if (GTK_IS_IMAGE(user_data)) {
+			gtk_image_set_from_icon_name(GTK_IMAGE(user_data), g_value_get_string(value), GTK_ICON_SIZE_MENU);
+		}
+	}
+
+	return;
+}
+
 /* Sets the label when it changes. */
 static void
 application_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, gpointer user_data)
@@ -266,6 +280,7 @@
 
 	/* Make sure we can handle the label changing */
 	g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(application_prop_change_cb), label);
+	g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(application_icon_change_cb), icon);
 
 	return TRUE;
 }


Follow ups