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
This commit is contained in:
parent
17a4bd51bb
commit
0c25c5d43d
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user