mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 02:40:07 +00:00
box: Use widget children list in count_expand_children
It's still less dereferencing than the previous code.
This commit is contained in:
parent
3babd184c0
commit
a9f9ef3f53
20
gtk/gtkbox.c
20
gtk/gtkbox.c
@ -332,21 +332,21 @@ count_expand_children (GtkBox *box,
|
|||||||
gint *expand_children)
|
gint *expand_children)
|
||||||
{
|
{
|
||||||
GtkBoxPrivate *private = box->priv;
|
GtkBoxPrivate *private = box->priv;
|
||||||
GList *children;
|
GtkWidget *child;
|
||||||
GtkBoxChild *child;
|
|
||||||
|
|
||||||
*visible_children = *expand_children = 0;
|
*visible_children = *expand_children = 0;
|
||||||
|
|
||||||
for (children = private->children; children; children = children->next)
|
for (child = _gtk_widget_get_first_child (GTK_WIDGET (box));
|
||||||
|
child != NULL;
|
||||||
|
child = _gtk_widget_get_next_sibling (child))
|
||||||
{
|
{
|
||||||
child = children->data;
|
if (_gtk_widget_get_visible (child))
|
||||||
|
{
|
||||||
|
*visible_children += 1;
|
||||||
|
|
||||||
if (_gtk_widget_get_visible (child->widget))
|
if (gtk_widget_compute_expand (child, private->orientation))
|
||||||
{
|
*expand_children += 1;
|
||||||
*visible_children += 1;
|
}
|
||||||
if (gtk_widget_compute_expand (child->widget, private->orientation))
|
|
||||||
*expand_children += 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user