summaryrefslogtreecommitdiff
path: root/gtk/gtkrevealer.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-02-19 13:22:02 +0100
committerMatthias Clasen <mclasen@redhat.com>2016-02-23 20:45:45 -0500
commit0c25c5d43d3a299698a54b31107339861e556a2d (patch)
tree3c919342fa07e2bffce514a57bf62f816eb9a573 /gtk/gtkrevealer.c
parent17a4bd51bb0975dada19c64324a5e77026570467 (diff)
downloadgtk+-0c25c5d43d3a299698a54b31107339861e556a2d.tar.gz
revealer: Don't report >0 preferred width...
... if the child is concealed and the transition type is set to NONE. In this case, both preferred width and preferred height should be 0, but we still can't use that to allocate a size for the child, so care about the minimum size of the child in gtk_revealer_get_child_allocation. https://bugzilla.gnome.org/show_bug.cgi?id=761760
Diffstat (limited to 'gtk/gtkrevealer.c')
-rw-r--r--gtk/gtkrevealer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index e4d144b56d..52ebd26b87 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -339,6 +339,13 @@ gtk_revealer_get_child_allocation (GtkRevealer *revealer,
transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT)
gtk_widget_get_preferred_width_for_height (child, MAX (0, allocation->height - vertical_padding), NULL,
&child_allocation->width);
+ else if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE)
+ {
+ gtk_widget_get_preferred_width_for_height (child, MAX (0, allocation->height - vertical_padding), NULL,
+ &child_allocation->width);
+ gtk_widget_get_preferred_height_for_width (child, MAX (0, allocation->width - horizontal_padding), NULL,
+ &child_allocation->height);
+ }
else
gtk_widget_get_preferred_height_for_width (child, MAX (0, allocation->width - horizontal_padding), NULL,
&child_allocation->height);
@@ -873,7 +880,8 @@ set_width_with_paddings (GtkRevealer *revealer,
natural_width = preferred_natural_width + horizontal_padding;
transition = effective_transition (revealer);
- if (transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT ||
+ if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE ||
+ transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT ||
transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT)
{
/* Paddings are included in the animation */