summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-02-18 22:43:04 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-02-18 22:50:37 -0500
commit5eaebde394ba755b1f614c7d0e7c5513cf531493 (patch)
tree70286c59e7356484ddacbd79219fc6f155c9c7e9
parent3f0e28133d561d6732233af404312cb757ca2b7d (diff)
downloadgtk+-5eaebde394ba755b1f614c7d0e7c5513cf531493.tar.gz
Add map/unmap to GtkActionBar
The recursion in map needs to follow the actual physical widget tree, otherwise we violate invariants. The generic container map implementation uses gtk_container_forall to operate on the children, and thus is not suitable for containers where the children are inside some internal container.
-rw-r--r--gtk/gtkactionbar.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk/gtkactionbar.c b/gtk/gtkactionbar.c
index 14faa134c4..012e4d10c9 100644
--- a/gtk/gtkactionbar.c
+++ b/gtk/gtkactionbar.c
@@ -137,6 +137,24 @@ gtk_action_bar_forall (GtkContainer *container,
gtk_container_forall (GTK_CONTAINER (priv->center_box), callback, callback_data);
}
+static void
+gtk_action_bar_map (GtkWidget *widget)
+{
+ GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (GTK_ACTION_BAR (widget));
+
+ gtk_widget_set_mapped (widget, TRUE);
+ gtk_widget_map (priv->revealer);
+}
+
+static void
+gtk_action_bar_unmap (GtkWidget *widget)
+{
+ GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (GTK_ACTION_BAR (widget));
+
+ gtk_widget_set_mapped (widget, FALSE);
+ gtk_widget_unmap (priv->revealer);
+}
+
static GType
gtk_action_bar_child_type (GtkContainer *container)
{
@@ -200,6 +218,8 @@ gtk_action_bar_class_init (GtkActionBarClass *klass)
widget_class->show = gtk_action_bar_show;
widget_class->hide = gtk_action_bar_hide;
+ widget_class->map = gtk_action_bar_map;
+ widget_class->unmap = gtk_action_bar_unmap;
container_class->add = gtk_action_bar_add;
container_class->remove = gtk_action_bar_remove;