summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBowon Ryu <bowon.ryu@samsung.com>2020-06-05 14:26:22 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-06-05 14:26:22 +0900
commitf4cf46e9b54a56357611ed709e04b3699810fdef (patch)
treeb53de05e468a2fa84cafec1723a0d83021a95ead /src
parent7c4253814456fcf168607df3fd5298980514b009 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_util.c2
-rw-r--r--src/tests/elementary/elm_test_entry.c21
2 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index a8071531e1..d3476cb2c0 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -6725,7 +6725,7 @@ edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *
6725 6725
6726 ed = _edje_fetch(obj); 6726 ed = _edje_fetch(obj);
6727 6727
6728 return _edje_efl_text_text_set((Eo *) obj, ed, part, text, EINA_TRUE, EINA_FALSE); 6728 return _edje_efl_text_text_set((Eo *) obj, ed, part, text, EINA_TRUE, EINA_TRUE);
6729} 6729}
6730 6730
6731EAPI const char * 6731EAPI const char *
diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c
index 200ff1e744..93951d9e45 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -480,6 +480,26 @@ EFL_START_TEST(elm_entry_text_set)
480} 480}
481EFL_END_TEST 481EFL_END_TEST
482 482
483EFL_START_TEST(elm_entry_guide_text_set)
484{
485 Evas_Object *win, *entry;
486 const char *markup_text = "<font_size=32 color=#FFF>markup_test</font_size>";
487 const char *markup_text2 = "<font_size=24 color=#FFF>test_markup</font_size>";
488
489 win = win_add(NULL, "entry", ELM_WIN_BASIC);
490
491 entry = elm_entry_add(win);
492
493 elm_object_part_text_set(entry, "elm.guide", markup_text);
494 elm_entry_editable_set(entry, EINA_FALSE);
495 ck_assert_str_eq(elm_object_part_text_get(entry, "elm.guide"), markup_text);
496
497 elm_object_part_text_set(entry, "elm.guide", markup_text2);
498 elm_entry_single_line_set(entry, EINA_FALSE);
499 ck_assert_str_eq(elm_object_part_text_get(entry, "elm.guide"), markup_text2);
500}
501EFL_END_TEST
502
483EFL_START_TEST(elm_entry_file_get_set) 503EFL_START_TEST(elm_entry_file_get_set)
484{ 504{
485 Evas_Object *win, *entry; 505 Evas_Object *win, *entry;
@@ -627,6 +647,7 @@ void elm_test_entry(TCase *tc)
627 tcase_add_test(tc, elm_entry_atspi_text_selections); 647 tcase_add_test(tc, elm_entry_atspi_text_selections);
628 tcase_add_test(tc, elm_atspi_role_get); 648 tcase_add_test(tc, elm_atspi_role_get);
629 tcase_add_test(tc, elm_entry_text_set); 649 tcase_add_test(tc, elm_entry_text_set);
650 tcase_add_test(tc, elm_entry_guide_text_set);
630 tcase_add_test(tc, elm_entry_magnifier); 651 tcase_add_test(tc, elm_entry_magnifier);
631 tcase_add_test(tc, elm_entry_file_get_set); 652 tcase_add_test(tc, elm_entry_file_get_set);
632 tcase_add_test(tc, elm_entry_test_text_class); 653 tcase_add_test(tc, elm_entry_test_text_class);