forked from enlightenment/efl
Evas table: Added "mirrored mode" to table. This is important for ui mirroring and let users do cooler stuff.
SVN revision: 56633
This commit is contained in:
parent
1cd89c7155
commit
36df64bbeb
|
@ -2075,6 +2075,8 @@ struct _Evas_Smart_Cb_Description
|
|||
EAPI void evas_object_table_padding_get (const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
|
||||
EAPI void evas_object_table_align_set (Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
|
||||
EAPI void evas_object_table_align_get (const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
|
||||
EAPI void evas_object_table_mirrored_set (Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool evas_object_table_mirrored_get (const Evas_Object *o) EINA_ARG_NONNULL(1);
|
||||
|
||||
EAPI Eina_Bool evas_object_table_pack (Evas_Object *o, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool evas_object_table_unpack (Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
|
||||
|
|
|
@ -62,6 +62,7 @@ struct _Evas_Object_Table_Data
|
|||
Eina_Bool hints_changed : 1;
|
||||
Eina_Bool expand_h : 1;
|
||||
Eina_Bool expand_v : 1;
|
||||
Eina_Bool is_mirrored : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Object_Table_Iterator
|
||||
|
@ -515,7 +516,14 @@ _evas_object_table_calculate_layout_homogeneous(Evas_Object *o, Evas_Object_Tabl
|
|||
|
||||
_evas_object_table_calculate_cell(opt, &cx, &cy, &cw, &ch);
|
||||
|
||||
evas_object_move(child, cx, cy);
|
||||
if (priv->is_mirrored)
|
||||
{
|
||||
evas_object_move(opt->obj, x + w - (cx - x + cw), cy);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_object_move(child, cx, cy);
|
||||
}
|
||||
evas_object_resize(child, cw, ch);
|
||||
}
|
||||
}
|
||||
|
@ -782,18 +790,25 @@ _evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Object_Table_Da
|
|||
{
|
||||
Evas_Object *child = opt->obj;
|
||||
Evas_Coord cx, cy, cw, ch;
|
||||
|
||||
|
||||
cx = x + opt->col * (priv->pad.h);
|
||||
cx += _evas_object_table_sum_sizes(cols, 0, opt->col);
|
||||
cw = _evas_object_table_sum_sizes(cols, opt->col, opt->end_col);
|
||||
|
||||
|
||||
cy = y + opt->row * (priv->pad.v);
|
||||
cy += _evas_object_table_sum_sizes(rows, 0, opt->row);
|
||||
ch = _evas_object_table_sum_sizes(rows, opt->row, opt->end_row);
|
||||
|
||||
|
||||
_evas_object_table_calculate_cell(opt, &cx, &cy, &cw, &ch);
|
||||
|
||||
evas_object_move(child, cx, cy);
|
||||
|
||||
if (priv->is_mirrored)
|
||||
{
|
||||
evas_object_move(opt->obj, x + w - (cx - x + cw), cy);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_object_move(child, cx, cy);
|
||||
}
|
||||
evas_object_resize(child, cw, ch);
|
||||
}
|
||||
|
||||
|
@ -1378,6 +1393,25 @@ evas_object_table_child_get(const Evas_Object *o, unsigned short col, unsigned s
|
|||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
evas_object_table_mirrored_get(const Evas_Object *obj)
|
||||
{
|
||||
EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(obj, priv, EINA_FALSE);
|
||||
|
||||
return priv->is_mirrored;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_object_table_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
|
||||
{
|
||||
EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(obj, priv);
|
||||
if (priv->is_mirrored != mirrored)
|
||||
{
|
||||
priv->is_mirrored = mirrored;
|
||||
_evas_object_table_smart_calculate_regular(obj, priv);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue