clutter-box-layout: Swap the default request mode

The request mode set by the box layout was previously width-for-height
in a vertical layout and height-for-width in a horizontal layout which
seems to be wrong. For example, if width-for-height is used in a
vertical layout then the width request will come second with the
for_height parameter set. However a vertical layout doesn't pass the
for_height parameter on to its children so doing the requests in that
order doesn't help. If the layout contains a ClutterText then both the
width and height request for it will have -1 for the for_width and
for_height parameters so the text would end up allocated too small.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2328
This commit is contained in:
Neil Roberts 2010-09-20 12:04:51 +01:00
parent 699e8bbed2
commit 8f4d61e663

View File

@ -477,9 +477,9 @@ clutter_box_layout_set_container (ClutterLayoutManager *layout,
/* we need to change the :request-mode of the container /* we need to change the :request-mode of the container
* to match the orientation * to match the orientation
*/ */
request_mode = (priv->is_vertical) request_mode = (priv->is_vertical
? CLUTTER_REQUEST_WIDTH_FOR_HEIGHT ? CLUTTER_REQUEST_HEIGHT_FOR_WIDTH
: CLUTTER_REQUEST_HEIGHT_FOR_WIDTH; : CLUTTER_REQUEST_WIDTH_FOR_HEIGHT);
clutter_actor_set_request_mode (CLUTTER_ACTOR (priv->container), clutter_actor_set_request_mode (CLUTTER_ACTOR (priv->container),
request_mode); request_mode);
} }