edje: markup flag should be TRUE in legacy edje_object_part_text_set

Summary:
Through some APIs (elm_entry_editable_set, elm_entry_single_line_set, etc.)
located after edje_object_part_text_set(legacy)

If efl_ui_widget_theme_apply is called,
In edje_object_part_text_raw_generic_set, the legacy flag becomes FALSE.
And in this case, the logic works in the unintended direction
because the set_markup flag is FALSE.

Test Plan:
/*
gcc -o entry_example entry.c `pkg-config --cflags --libs elementary`
 */
#include <Elementary.h>

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
   Evas_Object *win, *en;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("entry-example", "test");
   elm_win_autodel_set(win, EINA_TRUE);
   en = elm_entry_add(win);
   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_object_part_text_set(en, "elm.guide", "<font_size=32 color=#FFF>TEST</font_size>");
   elm_entry_editable_set(en, EINA_FALSE);

   evas_object_show(en);

   elm_object_content_set(win, en);
   evas_object_resize(win, 300, 200);
   evas_object_show(win);

   elm_run();

   return 0;
}
ELM_MAIN()

Reviewers: woohyun, ali.alzyod

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11868
This commit is contained in:
Bowon Ryu 2020-06-05 14:26:22 +09:00 committed by WooHyun Jung
parent 7c42538144
commit f4cf46e9b5
2 changed files with 22 additions and 1 deletions

View File

@ -6725,7 +6725,7 @@ edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *
ed = _edje_fetch(obj);
return _edje_efl_text_text_set((Eo *) obj, ed, part, text, EINA_TRUE, EINA_FALSE);
return _edje_efl_text_text_set((Eo *) obj, ed, part, text, EINA_TRUE, EINA_TRUE);
}
EAPI const char *

View File

@ -480,6 +480,26 @@ EFL_START_TEST(elm_entry_text_set)
}
EFL_END_TEST
EFL_START_TEST(elm_entry_guide_text_set)
{
Evas_Object *win, *entry;
const char *markup_text = "<font_size=32 color=#FFF>markup_test</font_size>";
const char *markup_text2 = "<font_size=24 color=#FFF>test_markup</font_size>";
win = win_add(NULL, "entry", ELM_WIN_BASIC);
entry = elm_entry_add(win);
elm_object_part_text_set(entry, "elm.guide", markup_text);
elm_entry_editable_set(entry, EINA_FALSE);
ck_assert_str_eq(elm_object_part_text_get(entry, "elm.guide"), markup_text);
elm_object_part_text_set(entry, "elm.guide", markup_text2);
elm_entry_single_line_set(entry, EINA_FALSE);
ck_assert_str_eq(elm_object_part_text_get(entry, "elm.guide"), markup_text2);
}
EFL_END_TEST
EFL_START_TEST(elm_entry_file_get_set)
{
Evas_Object *win, *entry;
@ -627,6 +647,7 @@ void elm_test_entry(TCase *tc)
tcase_add_test(tc, elm_entry_atspi_text_selections);
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_entry_text_set);
tcase_add_test(tc, elm_entry_guide_text_set);
tcase_add_test(tc, elm_entry_magnifier);
tcase_add_test(tc, elm_entry_file_get_set);
tcase_add_test(tc, elm_entry_test_text_class);