summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Erias Morandeira <femorandeira@igalia.com>2013-07-04 15:54:38 +0100
committerFelipe Erias Morandeira <femorandeira@igalia.com>2013-07-22 15:31:52 +0100
commit9d76c2ba3610cfb3baba3d1d8bd119f92c212a5b (patch)
treedef330c6a50f757749f0c0908faf7c6e2057d764
parentbf44cd5821a1beb6ff067b0dd654f10763a1c758 (diff)
eos_action_menu_remove_action() also removes the corresponding EosActionButton
[endlessm/eos-sdk#146]
-rw-r--r--endless/eosactionmenu.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/endless/eosactionmenu.c b/endless/eosactionmenu.c
index 4a0c5e8..18468dd 100644
--- a/endless/eosactionmenu.c
+++ b/endless/eosactionmenu.c
@@ -188,10 +188,34 @@ eos_action_menu_remove_action (EosActionMenu *menu,
GtkAction *action)
{
EosActionMenuPrivate *priv;
+ GList *children, *i;
+ GtkWidget *target_child = NULL;
+
g_return_if_fail (EOS_IS_ACTION_MENU (menu));
+ g_return_if_fail (GTK_IS_ACTION (action));
priv = menu->priv;
gtk_action_group_remove_action(priv->action_group, action);
+
+ children = gtk_container_get_children (GTK_CONTAINER (priv->grid));
+
+ for (i = children; i != NULL; i = i->next)
+ {
+ GtkWidget *child = i->data;
+ GtkAction *childs_action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (child));
+
+ if (childs_action != NULL &&
+ g_strcmp0 (gtk_action_get_name (childs_action), gtk_action_get_name (action)) == 0)
+ {
+ target_child = child;
+ break;
+ }
+ }
+
+ if (target_child != NULL)
+ {
+ gtk_widget_destroy (target_child);
+ }
}
/*