diff --git a/README.in b/README.in index 8511064179..c002e115eb 100644 --- a/README.in +++ b/README.in @@ -81,6 +81,13 @@ Release notes for 3.10 setups (not multi-monitor!) are very rare nowadays. If you really need multiple X screens, open them as separate displays. +* The behavior of GtkBox::expand has been changed to never propagate + up. Previously, this was happening inconsistently. If you want the + expand to propagate, use the GtkWidget h/v expand properties. + If you experience sizing problems with widgets in ported code, + carefully check the expand and fill flags of your boxes. + + Release notes for 3.8 ===================== diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index e60fb4fa90..94e89073cc 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -150,9 +150,6 @@ struct _GtkBoxChild static void gtk_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void gtk_box_compute_expand (GtkWidget *widget, - gboolean *hexpand, - gboolean *vexpand); static void gtk_box_direction_changed (GtkWidget *widget, GtkTextDirection previous_direction); @@ -230,7 +227,6 @@ gtk_box_class_init (GtkBoxClass *class) widget_class->get_preferred_height_for_width = gtk_box_get_preferred_height_for_width; widget_class->get_preferred_height_and_baseline_for_width = gtk_box_get_preferred_height_and_baseline_for_width; widget_class->get_preferred_width_for_height = gtk_box_get_preferred_width_for_height; - widget_class->compute_expand = gtk_box_compute_expand; widget_class->direction_changed = gtk_box_direction_changed; container_class->add = gtk_box_add; @@ -285,6 +281,9 @@ gtk_box_class_init (GtkBoxClass *class) * Note that the #GtkWidget:halign, #GtkWidget:valign, #GtkWidget:hexpand * and #GtkWidget:vexpand properties are the preferred way to influence * child size allocation in containers. + * + * In contrast to #GtkWidget::hexpand, the expand child property does + * not cause the box to expand itself. */ gtk_container_class_install_child_property (container_class, CHILD_PROP_EXPAND, @@ -779,53 +778,6 @@ gtk_box_size_allocate (GtkWidget *widget, } } -static void -gtk_box_compute_expand (GtkWidget *widget, - gboolean *hexpand_p, - gboolean *vexpand_p) -{ - GtkBoxPrivate *private = GTK_BOX (widget)->priv; - GList *children; - GtkBoxChild *child; - gboolean our_expand; - gboolean opposite_expand; - GtkOrientation opposite_orientation; - - opposite_orientation = OPPOSITE_ORIENTATION (private->orientation); - - our_expand = FALSE; - opposite_expand = FALSE; - - for (children = private->children; children; children = children->next) - { - child = children->data; - - /* we don't recurse into children anymore as soon as we know - * expand=TRUE in an orientation - */ - - if (child->expand || (!our_expand && gtk_widget_compute_expand (child->widget, private->orientation))) - our_expand = TRUE; - - if (!opposite_expand && gtk_widget_compute_expand (child->widget, opposite_orientation)) - opposite_expand = TRUE; - - if (our_expand && opposite_expand) - break; - } - - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - *hexpand_p = our_expand; - *vexpand_p = opposite_expand; - } - else - { - *hexpand_p = opposite_expand; - *vexpand_p = our_expand; - } -} - static GType gtk_box_child_type (GtkContainer *container) {