mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
stack: Use measure() to measure child widget
Simpler code this way \o/
This commit is contained in:
parent
6eb3d98de0
commit
82d38e35f8
@ -2330,20 +2330,7 @@ gtk_stack_measure (GtkCssGadget *gadget,
|
||||
|
||||
if (gtk_widget_get_visible (child))
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_VERTICAL)
|
||||
{
|
||||
if (for_size < 0)
|
||||
gtk_widget_get_preferred_height (child, &child_min, &child_nat);
|
||||
else
|
||||
gtk_widget_get_preferred_height_for_width (child, for_size, &child_min, &child_nat);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (for_size < 0)
|
||||
gtk_widget_get_preferred_width (child, &child_min, &child_nat);
|
||||
else
|
||||
gtk_widget_get_preferred_width_for_height (child, for_size, &child_min, &child_nat);
|
||||
}
|
||||
gtk_widget_measure (child, orientation, for_size, &child_min, &child_nat, NULL, NULL);
|
||||
|
||||
*minimum = MAX (*minimum, child_min);
|
||||
*natural = MAX (*natural, child_nat);
|
||||
|
Loading…
Reference in New Issue
Block a user