ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01300
[Branch ~indicator-applet-developers/indicator-messages/trunk] Rev 178: Grab changes in app icons.
Merge authors:
Ted Gould (ted)
Related merge proposals:
https://code.launchpad.net/~ted/indicator-messages/app-item-icon-refresh/+merge/22083
proposed by: Ted Gould (ted)
review: Approve - Cody Russell (bratsche)
------------------------------------------------------------
revno: 178 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-03-25 10:15:58 -0500
message:
Grab changes in app icons.
modified:
src/indicator-messages.c
--
lp:indicator-messages
https://code.launchpad.net/~indicator-applet-developers/indicator-messages/trunk
Your team ayatana-commits is subscribed to branch lp:indicator-messages.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/indicator-messages/trunk/+edit-subscription.
=== 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:10:48 +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;
}