From 700aebe394f9ef46126dbd0191ee8cb8a482d678 Mon Sep 17 00:00:00 2001 From: barbieri Date: Sat, 1 Nov 2008 13:36:58 +0000 Subject: [PATCH] Comments about box and table. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@37372 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_box.c | 18 ++++++++++++++++++ src/lib/canvas/evas_object_table.c | 14 +++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/lib/canvas/evas_object_box.c b/src/lib/canvas/evas_object_box.c index d116b27..f55d80b 100644 --- a/src/lib/canvas/evas_object_box.c +++ b/src/lib/canvas/evas_object_box.c @@ -652,6 +652,8 @@ _evas_object_box_layout_horizontal_weight_apply(Evas_Object_Box_Data *priv, Evas * resized bounded to a minimum or maximum size, their size hint * properties must be set (by the * evas_object_size_hint_{min,max}_set() functions. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -810,6 +812,8 @@ _evas_object_box_layout_vertical_weight_apply(Evas_Object_Box_Data *priv, Evas_O * This function behaves analogously to * evas_object_box_layout_horizontal(). The description of its * behaviour can be derived from that function's documentation. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -939,6 +943,8 @@ evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv) * value of -1.0 to @c align_y makes the box try to resize this child * element to the exact height of its parent (respecting the max hint * on the child's height). + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -1004,6 +1010,8 @@ evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Da * This function behaves analogously to * evas_object_box_layout_homogeneous_horizontal(). The description * of its behaviour can be derived from that function's documentation. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -1101,6 +1109,8 @@ evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data * value of -1.0 to @c align_y makes the box try to resize this child * element to the exact height of its parent (respecting the max hint * on the child's height). + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -1188,6 +1198,8 @@ evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Obje * evas_object_box_layout_homogeneous_max_size_horizontal(). The * description of its behaviour can be derived from that function's * documentation. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_homogeneous_max_size_vertical(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -1365,6 +1377,8 @@ _evas_object_box_layout_flow_horizontal_row_info_collect(Evas_Object_Box_Data *p * row justifying) of setting space between rows. Note, however, that * @c align_y dictates positioning relative to the *largest height* * required by a child object in the actual row. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -1532,6 +1546,8 @@ _evas_object_box_layout_flow_vertical_col_info_collect(Evas_Object_Box_Data *pri * This function behaves analogously to * evas_object_box_layout_flow_horizontal(). The description of its * behaviour can be derived from that function's documentation. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv) @@ -1648,6 +1664,8 @@ evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv) * (respecting the min and max hints on the child's width *and* * accounting its horizontal padding properties). Same applies to * vertical axis. + * + * @todo consider aspect hint and respect it. */ void evas_object_box_layout_stack(Evas_Object *o, Evas_Object_Box_Data *priv) diff --git a/src/lib/canvas/evas_object_table.c b/src/lib/canvas/evas_object_table.c index 1358f35..88fea7c 100644 --- a/src/lib/canvas/evas_object_table.c +++ b/src/lib/canvas/evas_object_table.c @@ -528,8 +528,6 @@ _evas_object_table_calculate_hints_regular(Evas_Object *o, Evas_Object_Table_Dat Evas_Object_Table_Cache *c; Eina_List *l; - // XXX TODO: account paddings! - if (!priv->cache) { priv->cache = _evas_object_table_cache_alloc @@ -565,6 +563,11 @@ _evas_object_table_calculate_hints_regular(Evas_Object *o, Evas_Object_Table_Dat ((opt->max.h > -1) && (opt->min.h < opt->max.h)))) opt->expand_v = 1; + if (opt->align.h < 0.0) + opt->align.h = 0.5; + if (opt->align.v < 0.0) + opt->align.v = 0.5; + if (opt->expand_h) memset(c->expands.h + opt->col, 1, opt->colspan); if (opt->expand_v) @@ -888,11 +891,16 @@ evas_object_table_smart_set(Evas_Smart_Class *sc) /** * Set how this table should layout children. * + * @todo consider aspect hint and respect it. + * * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE * If table does not use homogeneous mode then columns and rows will * be calculated based on hints of individual cells. This operation * mode is more flexible, but more complex and heavy to calculate as - * well. + * well. @b Weight properties are handled as a boolean + * expand. Negative alignment will be considered as 0.5. + * + * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight. * * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE * When homogeneous is relative to table the own table size is divided -- 2.7.4