diff options
author | Xan Lopez <xan@gnome.org> | 2011-02-21 10:16:38 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2011-02-21 10:16:38 +0800 |
commit | 91635045ce8c6b1d92c9d6d509565a0b569de15b (patch) | |
tree | 2a25a951fe227482480c9e4590fc633b6b0d5ca9 | |
parent | 69fb18cd0d7d9fc0459fb5faec59f77d4418981d (diff) | |
download | gsoc2013-epiphany-91635045ce8c6b1d92c9d6d509565a0b569de15b.tar.gz gsoc2013-epiphany-91635045ce8c6b1d92c9d6d509565a0b569de15b.tar.zst gsoc2013-epiphany-91635045ce8c6b1d92c9d6d509565a0b569de15b.zip |
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.
-rw-r--r-- | lib/widgets/gedit-overlay-child.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); } |