forked from enlightenment/efl
Evas Textblock: Fix text disappear issue when text is made up with multiple items.
Summary: Text is disappearing when we resize a singleline Evas Textblock with ellipsis. It is happened by putting a Text item at logical_items list without considering about logical position. It is only happended the text is made up with multiple items. @fix Test Plan: 1. Run elementary_test 2. Click Label Ellipsis 3. Resize the window dynamically and see the result. Reviewers: woohyun, tasn, herdsman Subscribers: jpeg, subodh6129, shilpasingh, cedric Maniphest Tasks: T2709 Differential Revision: https://phab.enlightenment.org/D3022
This commit is contained in:
parent
cb227cb5fb
commit
809d8fdafe
|
@ -4803,7 +4803,16 @@ _layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List *i)
|
||||||
|
|
||||||
if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap))
|
if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap))
|
||||||
{
|
{
|
||||||
_layout_item_text_split_strip_white(c, ti, i, wrap);
|
Eina_List *l = i;
|
||||||
|
|
||||||
|
while (l)
|
||||||
|
{
|
||||||
|
Evas_Object_Textblock_Item *iit = eina_list_data_get(l);
|
||||||
|
if (iit == _ITEM(ti)) break;
|
||||||
|
l = eina_list_prev(l);
|
||||||
|
}
|
||||||
|
|
||||||
|
_layout_item_text_split_strip_white(c, ti, l, wrap);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (wrap < 0)
|
else if (wrap < 0)
|
||||||
|
|
|
@ -2018,6 +2018,37 @@ START_TEST(evas_textblock_wrapping)
|
||||||
evas_object_textblock_size_formatted_get(tb, &w, &h);
|
evas_object_textblock_size_formatted_get(tb, &w, &h);
|
||||||
ck_assert_int_le(w, ellip_w);
|
ck_assert_int_le(w, ellip_w);
|
||||||
|
|
||||||
|
/* Ellipsis test for multiple items in singleline. */
|
||||||
|
{
|
||||||
|
evas_object_resize(tb, 500, 500);
|
||||||
|
evas_object_textblock_text_markup_set(tb, "ABC 한글한글 DEF");
|
||||||
|
evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0");
|
||||||
|
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||||
|
evas_object_resize(tb, nw, nh);
|
||||||
|
evas_object_textblock_size_formatted_get(tb, &w, &h);
|
||||||
|
|
||||||
|
/* Make the object's width smaller. */
|
||||||
|
for (i = 1; (nw / 5) <= (nw - i); i++)
|
||||||
|
{
|
||||||
|
evas_object_resize(tb, nw - i, nh);
|
||||||
|
evas_object_textblock_size_formatted_get(tb, &bw, &bh);
|
||||||
|
ck_assert_int_le(bw, w);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Revert the object's width to native width. */
|
||||||
|
for (; (nw - i) <= nw; i--)
|
||||||
|
{
|
||||||
|
evas_object_resize(tb, nw - i, nh);
|
||||||
|
evas_object_textblock_size_formatted_get(tb, &bw, &bh);
|
||||||
|
ck_assert_int_le(bw, w);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The object resized same as native size.
|
||||||
|
* So, formatted width and native width should be same
|
||||||
|
* just like our first check. */
|
||||||
|
ck_assert_int_eq(bw, w);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
double ellip;
|
double ellip;
|
||||||
for(ellip = 0.0; ellip <= 1.0; ellip = ellip + 0.1)
|
for(ellip = 0.0; ellip <= 1.0; ellip = ellip + 0.1)
|
||||||
|
|
Loading…
Reference in New Issue