Evas textblock: Add a test for multiline ellipsis.

This tests that even with multiline ellipsis, the ellipsis in the second
line is not overdone (i.e it only does ellipsis as needed).

This is a test for something we found out when we applied D1311 (for T1213).
This commit is contained in:
Tom Hacohen 2014-08-20 15:46:22 +01:00
parent 153b9d396b
commit 4f3ab0db34
1 changed files with 17 additions and 0 deletions

View File

@ -1752,6 +1752,10 @@ START_TEST(evas_textblock_wrapping)
/* Ellipsis */
int ellip_w = 0;
evas_object_textblock_text_markup_set(tb, "");
evas_object_textblock_size_native_get(tb, &ellip_w, NULL);
evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa<br/>b");
evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=word");
evas_object_textblock_size_native_get(tb, &nw, &nh);
@ -1801,6 +1805,19 @@ START_TEST(evas_textblock_wrapping)
}
}
evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa");
evas_object_textblock_size_native_get(tb, &nw, &nh);
evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=char");
nw /= 3;
nh *= 2;
evas_object_resize(tb, nw, nh);
{
evas_object_textblock_line_number_geometry_get(tb, 1, NULL, NULL, &w, NULL);
ck_assert_int_gt(w, ellip_w);
}
/* Word wrap ending with whites. */
evas_object_resize(tb, 322, 400);
evas_object_textblock_text_markup_set(tb, "<wrap=word>This is an example text that should break at the end aaa ");