If halign=fill, force adjustment to height-for-width.
If valign=fill, force adjustment to width-for-height.
Otherwise look at request mode.
This way we don't try to adapt the filled dimension and only adjust
the one that is not set to fill.
/* Note that adjust_for_align removes any margins from the
* allocated sizes and possibly limits them to the natural sizes */
- if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
+ if (priv->halign == GTK_ALIGN_FILL ||
+ (priv->valign != GTK_ALIGN_FILL &&
+ gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH))
{
gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL,
allocation->height + priv->margin.top + priv->margin.bottom,
<property name="default-height">300</property>
<property name="decorated">0</property>
<child>
- <object class="GtkBox">
+ <object class="GtkLabel">
<property name="halign">center</property>
- <child>
- <object class="GtkLabel">
- <property name="halign">center</property>
- <property name="label">Hello World</property>
- <property name="wrap">True</property>
- </object>
- </child>
+ <property name="label">Hello World</property>
+ <property name="wrap">True</property>
</object>
</child>
</object>