parent
6d4a9a2337
commit
36db7b296f
|
@ -284,6 +284,7 @@ collections {
|
|||
// fit: 0 1;
|
||||
// min: 1 1;
|
||||
align: 0.0 0.5;
|
||||
elipsis: 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,6 +187,7 @@ collections
|
|||
// fit: 0 0;
|
||||
// min: 1 1;
|
||||
// align: 0.5 0.5;
|
||||
// alipsis: 0.0;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ static void st_collections_group_parts_part_description_text_min(void);
|
|||
static void st_collections_group_parts_part_description_text_align(void);
|
||||
static void st_collections_group_parts_part_description_text_source(void);
|
||||
static void st_collections_group_parts_part_description_text_text_source(void);
|
||||
static void st_collections_group_parts_part_description_text_elipsis(void);
|
||||
|
||||
static void ob_collections_group_programs_program(void);
|
||||
static void st_collections_group_programs_program_name(void);
|
||||
|
@ -193,6 +194,7 @@ New_Statement_Handler statement_handlers[] =
|
|||
{"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source},
|
||||
{"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
|
||||
{"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
|
||||
{"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis},
|
||||
{"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
|
||||
{"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
|
||||
{"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
|
||||
|
@ -2020,6 +2022,31 @@ st_collections_group_parts_part_description_text_text_source(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_description_text_elipsis(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
check_arg_count(1);
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
|
||||
if (ep->type != EDJE_PART_TYPE_TEXT)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||
"text attributes in non-TEXT part.\n",
|
||||
progname, file_in, line - 1);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||
ed->text.elipsis = parse_float_range(0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
static void
|
||||
ob_collections_group_programs_program(void)
|
||||
{
|
||||
|
|
|
@ -879,6 +879,7 @@ _edje_part_recalc_single(Edje *ed,
|
|||
{
|
||||
params->text.align.y = desc->text.align.y;
|
||||
}
|
||||
params->text.elipsis = desc->text.elipsis;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1008,6 +1009,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
|
||||
p3.text.align.x = (p1.text.align.x * (1.0 - pos)) + (p2.text.align.x * (pos));
|
||||
p3.text.align.y = (p1.text.align.y * (1.0 - pos)) + (p2.text.align.y * (pos));
|
||||
p3.text.elipsis = (p1.text.elipsis * (1.0 - pos)) + (p2.text.elipsis * (pos));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -238,6 +238,7 @@ _edje_edd_setup(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.align.y", text.align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_text_source", text.id_text_source, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.elipsis", text.elipsis, EET_T_DOUBLE);
|
||||
|
||||
_edje_edd_edje_part =
|
||||
NEWD("Edje_Part",
|
||||
|
|
|
@ -427,6 +427,7 @@ struct _Edje_Part_Description
|
|||
|
||||
int id_source; /* -1 if none */
|
||||
int id_text_source; /* -1 if none */
|
||||
double elipsis; /* 0.0 - 1.0 defining where the elipsis align */
|
||||
} text;
|
||||
};
|
||||
|
||||
|
@ -558,6 +559,7 @@ struct _Edje_Real_Part
|
|||
char *out_str;
|
||||
int out_size;
|
||||
double align_x, align_y;
|
||||
double elipsis;
|
||||
} cache;
|
||||
Edje_Real_Part *source;
|
||||
Edje_Real_Part *text_source;
|
||||
|
@ -621,6 +623,7 @@ struct _Edje_Calc_Params
|
|||
struct {
|
||||
double x, y; /* text alignment within bounds */
|
||||
} align;
|
||||
double elipsis;
|
||||
} text;
|
||||
};
|
||||
|
||||
|
|
|
@ -340,16 +340,16 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep,
|
|||
|
||||
evas_object_geometry_get(ep->object, NULL, NULL, &tw, &th);
|
||||
|
||||
p = ((sw - tw) * params->text.align.x);
|
||||
p = ((sw - tw) * params->text.elipsis);
|
||||
|
||||
/* chop chop */
|
||||
if (tw > sw)
|
||||
{
|
||||
if (params->text.align.x != 0.0)
|
||||
if (params->text.elipsis != 0.0)
|
||||
c1 = evas_object_text_char_coords_get(ep->object,
|
||||
-p, th / 2,
|
||||
NULL, NULL, NULL, NULL);
|
||||
if (params->text.align.x != 1.0)
|
||||
if (params->text.elipsis != 1.0)
|
||||
c2 = evas_object_text_char_coords_get(ep->object,
|
||||
-p + sw, th / 2,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
@ -575,7 +575,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
(text) &&
|
||||
(!strcmp(ep->text.cache.in_str, text)) &&
|
||||
(ep->text.cache.align_x == params->text.align.x) &&
|
||||
(ep->text.cache.align_y == params->text.align.y))
|
||||
(ep->text.cache.align_y == params->text.align.y) &&
|
||||
(ep->text.cache.elipsis == params->text.elipsis))
|
||||
{
|
||||
text = ep->text.cache.out_str;
|
||||
size = ep->text.cache.out_size;
|
||||
|
@ -703,6 +704,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
ep->text.cache.out_size = size;
|
||||
ep->text.cache.align_x = params->text.align.x;
|
||||
ep->text.cache.align_y = params->text.align.y;
|
||||
ep->text.cache.elipsis = params->text.elipsis;
|
||||
arrange_text:
|
||||
|
||||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
|
|
Loading…
Reference in New Issue