From 91635045ce8c6b1d92c9d6d509565a0b569de15b Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 21 Feb 2011 03:16:38 +0100 Subject: gedit-overlay-child: sync visible property of container and child That way user can hide the inner widget and the overlay child container will be hidden automatically. --- lib/widgets/gedit-overlay-child.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/widgets/gedit-overlay-child.c b/lib/widgets/gedit-overlay-child.c index deb942533..c97162fe6 100644 --- a/lib/widgets/gedit-overlay-child.c +++ b/lib/widgets/gedit-overlay-child.c @@ -24,7 +24,8 @@ struct _GeditOverlayChildPrivate { - GtkWidget *widget; + GtkWidget *widget; + GBinding *binding; GtkAllocation widget_alloc; GeditOverlayChildPosition position; guint offset; @@ -182,6 +183,10 @@ gedit_overlay_child_add (GtkContainer *container, child->priv->widget = widget; + child->priv->binding = g_object_bind_property (G_OBJECT (widget), "visible", + G_OBJECT (container), "visible", + G_BINDING_BIDIRECTIONAL); + GTK_CONTAINER_CLASS (gedit_overlay_child_parent_class)->add (container, widget); } @@ -193,6 +198,8 @@ gedit_overlay_child_remove (GtkContainer *container, child->priv->widget = NULL; + g_object_unref (child->priv->binding); + GTK_CONTAINER_CLASS (gedit_overlay_child_parent_class)->remove (container, widget); } -- cgit v1.2.3