diff options
author | Xan Lopez <xan@gnome.org> | 2011-02-16 20:03:33 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2011-02-16 20:03:33 +0800 |
commit | 6087d7632df9c47377731b851022661bddcbf9e4 (patch) | |
tree | be1f2265f72ec243aa77ce0a6a97c3048a26c5ce | |
parent | 10d814562be5f0531536cef6060d0db142fab8a5 (diff) | |
download | gsoc2013-epiphany-6087d7632df9c47377731b851022661bddcbf9e4.tar.gz gsoc2013-epiphany-6087d7632df9c47377731b851022661bddcbf9e4.tar.zst gsoc2013-epiphany-6087d7632df9c47377731b851022661bddcbf9e4.zip |
gedit-overlay: always proxy main widget size request
We don't want for the children to be able to overflow the main widget,
it makes sense to keep them contained in the overlay.
Bug #642451
-rw-r--r-- | lib/widgets/gedit-overlay.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/lib/widgets/gedit-overlay.c b/lib/widgets/gedit-overlay.c index 16ee8cf78..902f13daa 100644 --- a/lib/widgets/gedit-overlay.c +++ b/lib/widgets/gedit-overlay.c @@ -150,24 +150,13 @@ gedit_overlay_get_preferred_width (GtkWidget *widget, gint *natural) { GeditOverlayPrivate *priv = GEDIT_OVERLAY (widget)->priv; - GtkWidget *child; - GSList *children; - gint child_min, child_nat; *minimum = 0; *natural = 0; - for (children = priv->children; children; children = children->next) + if (priv->main_widget) { - child = children->data; - - if (!gtk_widget_get_visible (child)) - continue; - - gtk_widget_get_preferred_width (child, &child_min, &child_nat); - - *minimum = MAX (*minimum, child_min); - *natural = MAX (*natural, child_nat); + gtk_widget_get_preferred_width (priv->main_widget, minimum, natural); } } @@ -177,24 +166,13 @@ gedit_overlay_get_preferred_height (GtkWidget *widget, gint *natural) { GeditOverlayPrivate *priv = GEDIT_OVERLAY (widget)->priv; - GtkWidget *child; - GSList *children; - gint child_min, child_nat; *minimum = 0; *natural = 0; - for (children = priv->children; children; children = children->next) + if (priv->main_widget) { - child = children->data; - - if (!gtk_widget_get_visible (child)) - continue; - - gtk_widget_get_preferred_height (child, &child_min, &child_nat); - - *minimum = MAX (*minimum, child_min); - *natural = MAX (*natural, child_nat); + gtk_widget_get_preferred_height (priv->main_widget, minimum, natural); } } |