forked from enlightenment/efl
evas table -> allow packing of same object again to update packing
parameters SVN revision: 60446
This commit is contained in:
parent
d932f0b0c5
commit
5c5581fc95
|
@ -402,3 +402,9 @@
|
||||||
* Use Eina_File for JPEG loader.
|
* Use Eina_File for JPEG loader.
|
||||||
* Add evas_object_image_load_orientation_get and evas_object_image_load_orientation_set,
|
* Add evas_object_image_load_orientation_get and evas_object_image_load_orientation_set,
|
||||||
that tell if we should honor the orientation information when loading image file.
|
that tell if we should honor the orientation information when loading image file.
|
||||||
|
|
||||||
|
2011-06-17 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Allow evas table to re-pack the same object without error and just
|
||||||
|
update packing parameters
|
||||||
|
|
||||||
|
|
|
@ -1064,18 +1064,15 @@ evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, u
|
||||||
}
|
}
|
||||||
|
|
||||||
opt = _evas_object_table_option_get(child);
|
opt = _evas_object_table_option_get(child);
|
||||||
if (opt)
|
if (!opt)
|
||||||
{
|
{
|
||||||
ERR("cannot add object that is already part of a table!");
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
opt = malloc(sizeof(*opt));
|
opt = malloc(sizeof(*opt));
|
||||||
if (!opt)
|
if (!opt)
|
||||||
{
|
{
|
||||||
ERR("could not allocate table option data.");
|
ERR("could not allocate table option data.");
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
opt->obj = child;
|
opt->obj = child;
|
||||||
opt->col = col;
|
opt->col = col;
|
||||||
|
@ -1084,6 +1081,39 @@ evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, u
|
||||||
opt->rowspan = rowspan;
|
opt->rowspan = rowspan;
|
||||||
opt->end_col = col + colspan;
|
opt->end_col = col + colspan;
|
||||||
opt->end_row = row + rowspan;
|
opt->end_row = row + rowspan;
|
||||||
|
|
||||||
|
if (evas_object_smart_parent_get(child) == o)
|
||||||
|
{
|
||||||
|
Eina_Bool need_shrink = EINA_FALSE;
|
||||||
|
|
||||||
|
if (priv->size.cols < opt->end_col)
|
||||||
|
priv->size.cols = opt->end_col;
|
||||||
|
else
|
||||||
|
need_shrink = EINA_TRUE;
|
||||||
|
if (priv->size.rows < opt->end_row)
|
||||||
|
priv->size.rows = opt->end_row;
|
||||||
|
else
|
||||||
|
need_shrink = EINA_TRUE;
|
||||||
|
|
||||||
|
if (need_shrink)
|
||||||
|
{
|
||||||
|
Eina_List *l;
|
||||||
|
Evas_Object_Table_Option *opt2;
|
||||||
|
int max_row, max_col;
|
||||||
|
|
||||||
|
max_row = 0;
|
||||||
|
max_col = 0;
|
||||||
|
EINA_LIST_FOREACH(priv->children, l, opt2)
|
||||||
|
{
|
||||||
|
if (max_col < opt->end_col) max_col = opt->end_col;
|
||||||
|
if (max_row < opt->end_row) max_row = opt->end_row;
|
||||||
|
}
|
||||||
|
priv->size.cols = max_col;
|
||||||
|
priv->size.rows = max_row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
opt->min.w = 0;
|
opt->min.w = 0;
|
||||||
opt->min.h = 0;
|
opt->min.h = 0;
|
||||||
opt->max.w = 0;
|
opt->max.w = 0;
|
||||||
|
@ -1107,9 +1137,9 @@ evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, u
|
||||||
_evas_object_table_option_set(child, opt);
|
_evas_object_table_option_set(child, opt);
|
||||||
evas_object_smart_member_add(child, o);
|
evas_object_smart_member_add(child, o);
|
||||||
_evas_object_table_child_connect(o, child);
|
_evas_object_table_child_connect(o, child);
|
||||||
|
}
|
||||||
_evas_object_table_cache_invalidate(priv);
|
_evas_object_table_cache_invalidate(priv);
|
||||||
evas_object_smart_changed(o);
|
evas_object_smart_changed(o);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue