aboutsummaryrefslogtreecommitdiff
path: root/src/libappindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-08 10:44:15 -0600
committerTed Gould <ted@gould.cx>2010-03-08 10:44:15 -0600
commita503e71342f8dc7bc11e80564ffb7ac8e68a1846 (patch)
tree11c77e8b06221574407b597881713bdee5953b38 /src/libappindicator
parentfa723603dce8e5fd24371b5358a4ea3bc9ed8bc0 (diff)
parent27a7bb9a2b8518f2ff02e14fac1aaabca4aafaf5 (diff)
downloadayatana-indicator-application-a503e71342f8dc7bc11e80564ffb7ac8e68a1846.tar.gz
ayatana-indicator-application-a503e71342f8dc7bc11e80564ffb7ac8e68a1846.tar.bz2
ayatana-indicator-application-a503e71342f8dc7bc11e80564ffb7ac8e68a1846.zip
Workaround to make action label updates get caught and update the label.
Diffstat (limited to 'src/libappindicator')
-rw-r--r--src/libappindicator/app-indicator.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index ef9f5c0..5edc9fe 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -1160,6 +1160,21 @@ widget_notify_cb (GtkWidget *widget,
}
static void
+action_notify_cb (GtkAction *action,
+ GParamSpec *pspec,
+ gpointer data)
+{
+ DbusmenuMenuitem *child = (DbusmenuMenuitem *)data;
+
+ if (pspec->name == g_intern_static_string ("label"))
+ {
+ dbusmenu_menuitem_property_set (child,
+ DBUSMENU_MENUITEM_PROP_LABEL,
+ gtk_action_get_label (action));
+ }
+}
+
+static void
container_iterate (GtkWidget *widget,
gpointer data)
{
@@ -1281,6 +1296,24 @@ container_iterate (GtkWidget *widget,
g_signal_connect (widget, "notify",
G_CALLBACK (widget_notify_cb), child);
+ if (GTK_IS_ACTIVATABLE (widget))
+ {
+ GtkActivatable *activatable = GTK_ACTIVATABLE (widget);
+
+ if (gtk_activatable_get_use_action_appearance (activatable))
+ {
+ GtkAction *action = gtk_activatable_get_related_action (activatable);
+
+ if (action)
+ {
+ g_signal_connect_object (action, "notify",
+ G_CALLBACK (action_notify_cb),
+ child,
+ G_CONNECT_AFTER);
+ }
+ }
+ }
+
g_signal_connect (G_OBJECT (child),
DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK (activate_menuitem), widget);