mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
revealer: Measure child widget size using gtk_widget_measure
This commit is contained in:
parent
7f8d0acfd3
commit
1ab3d32808
@ -316,11 +316,13 @@ gtk_revealer_get_child_allocation (GtkRevealer *revealer,
|
||||
transition = effective_transition (revealer);
|
||||
if (transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT ||
|
||||
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);
|
||||
gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL,
|
||||
MAX (0, allocation->height - vertical_padding),
|
||||
NULL, &child_allocation->width, NULL, NULL);
|
||||
else
|
||||
gtk_widget_get_preferred_height_for_width (child, MAX (0, allocation->width - horizontal_padding), NULL,
|
||||
&child_allocation->height);
|
||||
gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL,
|
||||
MAX (0, allocation->width - horizontal_padding),
|
||||
NULL, &child_allocation->height, NULL, NULL);
|
||||
}
|
||||
|
||||
child_allocation->width = MAX (child_allocation->width, allocation->width - horizontal_padding);
|
||||
|
Loading…
Reference in New Issue
Block a user