box: Do not short-circuit size negotiation for empty Boxes

The LayoutManager used might decide to have a default allocation or a
default preferred size when empty.
This commit is contained in:
Emmanuele Bassi 2010-02-24 12:08:07 +00:00
parent 523bab0868
commit aa8c812705

View File

@ -308,20 +308,6 @@ clutter_box_real_get_preferred_width (ClutterActor *actor,
{
ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv;
/* if we don't have any children don't bother proxying the
* call to the layout manager instance
*/
if (priv->children == NULL || priv->manager == NULL)
{
if (min_width)
*min_width = 0.0;
if (natural_width)
*natural_width = 0.0;
return;
}
clutter_layout_manager_get_preferred_width (priv->manager,
CLUTTER_CONTAINER (actor),
for_height,
@ -336,20 +322,6 @@ clutter_box_real_get_preferred_height (ClutterActor *actor,
{
ClutterBoxPrivate *priv = CLUTTER_BOX (actor)->priv;
/* if we don't have any children don't bother proxying the
* call to the layout manager instance
*/
if (priv->children == NULL || priv->manager == NULL)
{
if (min_height)
*min_height = 0.0;
if (natural_height)
*natural_height = 0.0;
return;
}
clutter_layout_manager_get_preferred_height (priv->manager,
CLUTTER_CONTAINER (actor),
for_width,
@ -367,9 +339,6 @@ clutter_box_real_allocate (ClutterActor *actor,
klass = CLUTTER_ACTOR_CLASS (clutter_box_parent_class);
klass->allocate (actor, allocation, flags);
if (priv->children == NULL || priv->manager == NULL)
return;
clutter_layout_manager_allocate (priv->manager,
CLUTTER_CONTAINER (actor),
allocation, flags);