summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorTaehyub Kim <taehyub.kim@samsung.com>2020-06-10 15:39:03 +0900
committerHermet Park <chuneon.park@samsung.com>2020-06-10 15:39:03 +0900
commit4331c1e08eb43162635aa99125319d569dae9f45 (patch)
tree5fc38c400a1b3a9ba4e26a9f3ce9ff941a56c72b /src/bin
parent4f6a086f6ad9e0151e32930bafb6e85d5cb8f826 (diff)
efl_ui_textpath: add the efl_ui_textpath_text_user_style_set API for applying the user text style
Summary: For the text style customizing, added the new API to apply user text style. The following example is the user style sample. DEFAULT='font_size=16 color=#F00 underline=on underline_color=#00ffff'"; {F3899541} Test Plan: 1. run elementary_text (textpath) 2. toggle user style check box 3. see the result Reviewers: Hermet, kimcinoo, jsuya, bu5hm4n Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11953
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elementary/test_ui_textpath.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c
index 40317a9627..41783386b1 100644
--- a/src/bin/elementary/test_ui_textpath.c
+++ b/src/bin/elementary/test_ui_textpath.c
@@ -56,6 +56,20 @@ _short_text_changed_cb(void *data, const Efl_Event *event)
56 efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT); 56 efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT);
57} 57}
58 58
59static char *user_style = "DEFAULT='font_size=16 color=#F00 underline=on underline_color=#00ffff'";
60
61static void
62_user_style_changed_cb(void *data, const Efl_Event *event)
63{
64 Evas_Object *txtpath = data;
65 Eina_Bool val = elm_check_selected_get(event->object);
66
67 if (val)
68 elm_textpath_text_user_style_set(txtpath, user_style);
69 else
70 elm_textpath_text_user_style_set(txtpath, NULL);
71}
72
59static void 73static void
60_change_shape_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 74_change_shape_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
61{ 75{
@@ -138,6 +152,12 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
138 elm_box_pack_end(hbox, chk); 152 elm_box_pack_end(hbox, chk);
139 efl_gfx_entity_visible_set(chk, EINA_TRUE); 153 efl_gfx_entity_visible_set(chk, EINA_TRUE);
140 154
155 chk = efl_add(EFL_UI_CHECK_CLASS, win);
156 efl_text_set(chk, "User style");
157 efl_event_callback_add(chk, EFL_UI_EVENT_SELECTED_CHANGED, _user_style_changed_cb, txtpath);
158 elm_box_pack_end(hbox, chk);
159 efl_gfx_entity_visible_set(chk, EINA_TRUE);
160
141 hbox = elm_box_add(win); 161 hbox = elm_box_add(win);
142 elm_box_horizontal_set(hbox, EINA_TRUE); 162 elm_box_horizontal_set(hbox, EINA_TRUE);
143 efl_gfx_hint_weight_set(hbox, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND); 163 efl_gfx_hint_weight_set(hbox, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND);