boxlayout: Don't listen to comments

... when they are wrong.

Instead, remove them.

Or in other words: GTK4 does not have a fill child property anymore, so
we don't need to run the measuring loop above to determine the size.
This commit is contained in:
Benjamin Otte 2021-11-08 17:49:15 +01:00
parent b004706009
commit afe94e303a

View File

@ -322,6 +322,13 @@ gtk_box_layout_compute_opposite_size_for_size (GtkBoxLayout *self,
sizes = g_newa (GtkRequestedSize, nvis_children);
extra_space = MAX (0, for_size - (nvis_children - 1) * spacing);
if (self->homogeneous)
{
size_given_to_child = extra_space / nvis_children;
n_extra_widgets = extra_space % nvis_children;
}
else
{
/* Retrieve desired size for visible children */
for (i = 0, child = _gtk_widget_get_first_child (widget);
child != NULL;
@ -358,17 +365,6 @@ gtk_box_layout_compute_opposite_size_for_size (GtkBoxLayout *self,
i += 1;
}
if (self->homogeneous)
{
/* We still need to run the above loop to populate the minimum sizes for
* children that aren't going to fill.
*/
size_given_to_child = extra_space / nvis_children;
n_extra_widgets = extra_space % nvis_children;
}
else
{
/* Bring children up to size first */
extra_space -= children_minimum_size;
extra_space = MAX (0, extra_space);