forked from enlightenment/efl
whover did table and box support forgot:
1. table to have min.h/v ability like box 2. to ACTUALLY implement box h/v (and well of course implement tableh/v too) this basically fixes this working at all and completes the feature to table too. SVN revision: 59960
This commit is contained in:
parent
5886a2ed27
commit
d02f25e1ff
|
@ -214,6 +214,7 @@ static void st_collections_group_parts_part_description_box_min(void);
|
|||
static void st_collections_group_parts_part_description_table_homogeneous(void);
|
||||
static void st_collections_group_parts_part_description_table_align(void);
|
||||
static void st_collections_group_parts_part_description_table_padding(void);
|
||||
static void st_collections_group_parts_part_description_table_min(void);
|
||||
static void st_collections_group_parts_part_description_map_perspective(void);
|
||||
static void st_collections_group_parts_part_description_map_light(void);
|
||||
static void st_collections_group_parts_part_description_map_rotation_center(void);
|
||||
|
@ -470,6 +471,7 @@ New_Statement_Handler statement_handlers[] =
|
|||
{"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous},
|
||||
{"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
|
||||
{"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
|
||||
{"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
|
||||
{"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
|
||||
{"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
|
||||
{"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center},
|
||||
|
@ -6106,6 +6108,7 @@ st_collections_group_parts_part_description_box_min(void)
|
|||
homogeneous: TABLE;
|
||||
padding: 0 2;
|
||||
align: 0.5 0.5;
|
||||
min: 0 0;
|
||||
}
|
||||
..
|
||||
}
|
||||
|
@ -6143,6 +6146,16 @@ st_collections_group_parts_part_description_box_min(void)
|
|||
@effect
|
||||
Sets the space between cells in pixels. Defaults to 0 0.
|
||||
@endproperty
|
||||
|
||||
@property
|
||||
min
|
||||
@parameters
|
||||
[horizontal] [vertical]
|
||||
@effect
|
||||
When any of the parameters is enabled (1) it forces the minimum size of
|
||||
the table to be equal to the minimum size of the items. The default
|
||||
value is "0 0".
|
||||
@endproperty
|
||||
*/
|
||||
static void st_collections_group_parts_part_description_table_homogeneous(void)
|
||||
{
|
||||
|
@ -6225,6 +6238,32 @@ static void st_collections_group_parts_part_description_table_padding(void)
|
|||
ed->table.padding.y = parse_int_range(1, 0, 0x7fffffff);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_description_table_min(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
Edje_Part_Description_Table *ed;
|
||||
|
||||
check_arg_count(2);
|
||||
|
||||
pc = eina_list_data_get(eina_list_last(edje_collections));
|
||||
ep = pc->parts[pc->parts_count - 1];
|
||||
|
||||
if (ep->type != EDJE_PART_TYPE_TABLE)
|
||||
{
|
||||
ERR("%s: Error. parse error %s:%i. "
|
||||
"box attributes in non-TABLE part.",
|
||||
progname, file_in, line - 1);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
ed = (Edje_Part_Description_Table*) ep->default_desc;
|
||||
if (ep->other.desc_count) ed = (Edje_Part_Description_Table*) ep->other.desc[ep->other.desc_count - 1];
|
||||
|
||||
ed->table.min.h = parse_bool(0);
|
||||
ed->table.min.v = parse_bool(1);
|
||||
}
|
||||
|
||||
/**
|
||||
@edcsection{description_map,Map state description sub blocks}
|
||||
|
|
|
@ -1543,6 +1543,43 @@ _edje_part_recalc_single(Edje *ed,
|
|||
_edje_part_recalc_single_textblock(sc, ed, ep, (Edje_Part_Description_Text*) chosen_desc, params, &minw, &minh, &maxw, &maxh);
|
||||
else if (ep->part->type == EDJE_PART_TYPE_TEXT)
|
||||
_edje_part_recalc_single_text(sc, ed, ep, (Edje_Part_Description_Text*) desc, (Edje_Part_Description_Text*) chosen_desc, params, &minw, &minh, &maxw, &maxh);
|
||||
|
||||
if ((ep->part->type == EDJE_PART_TYPE_TABLE) &&
|
||||
(((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) ||
|
||||
(((Edje_Part_Description_Table *)chosen_desc)->table.min.v))))
|
||||
{
|
||||
Evas_Coord lminw = 0, lminh = 0;
|
||||
|
||||
evas_object_smart_need_recalculate_set(ep->object, 1);
|
||||
evas_object_smart_calculate(ep->object);
|
||||
evas_object_size_hint_min_get(ep->object, &lminw, &lminh);
|
||||
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h)
|
||||
{
|
||||
if (lminw > minw) minw = lminw;
|
||||
}
|
||||
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.v)
|
||||
{
|
||||
if (lminh > minh) minh = lminh;
|
||||
}
|
||||
}
|
||||
else if ((ep->part->type == EDJE_PART_TYPE_BOX) &&
|
||||
((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) ||
|
||||
(((Edje_Part_Description_Box *)chosen_desc)->box.min.v)))
|
||||
{
|
||||
Evas_Coord lminw = 0, lminh = 0;
|
||||
|
||||
evas_object_smart_need_recalculate_set(ep->object, 1);
|
||||
evas_object_smart_calculate(ep->object);
|
||||
evas_object_size_hint_min_get(ep->object, &lminw, &lminh);
|
||||
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h)
|
||||
{
|
||||
if (lminw > minw) minw = lminw;
|
||||
}
|
||||
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.v)
|
||||
{
|
||||
if (lminh > minh) minh = lminh;
|
||||
}
|
||||
}
|
||||
|
||||
/* remember what our size is BEFORE we go limit it */
|
||||
params->req.x = params->x;
|
||||
|
|
|
@ -665,6 +665,8 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.align.y", table.align.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.padding.x", table.padding.x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.padding.y", table.padding.y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.min.h", table.min.h, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.min.v", table.min.v, EET_T_UCHAR);
|
||||
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_External);
|
||||
eddc.func.mem_free = mem_free_external;
|
||||
|
|
|
@ -887,7 +887,7 @@ struct _Edje_Part_Description_Spec_Box
|
|||
int x, y;
|
||||
} padding;
|
||||
struct {
|
||||
Eina_Bool h, v;
|
||||
unsigned char h, v;
|
||||
} min;
|
||||
};
|
||||
|
||||
|
@ -898,6 +898,9 @@ struct _Edje_Part_Description_Spec_Table
|
|||
struct {
|
||||
int x, y;
|
||||
} padding;
|
||||
struct {
|
||||
unsigned char h, v;
|
||||
} min;
|
||||
};
|
||||
|
||||
struct _Edje_Part_Description_Image
|
||||
|
|
Loading…
Reference in New Issue