Page MenuHomePhabricator

efl_ui_textpath: add the efl_ui_textpath_text_user_style_set API for applying the user text style
ClosedPublic

Authored by herb on Jun 9 2020, 2:13 AM.

Details

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'";

Test Plan
  1. run elementary_text (textpath)
  2. toggle user style check box
  3. see the result

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
herb created this revision.Jun 9 2020, 2:13 AM
herb requested review of this revision.Jun 9 2020, 2:13 AM
Hermet requested changes to this revision.Jun 9 2020, 6:43 PM

I think we can only support Legacy API, not interface.

This revision now requires changes to proceed.Jun 9 2020, 6:43 PM
herb updated this revision to Diff 30593.Jun 9 2020, 7:44 PM

remove interface and support legacy API

herb updated this revision to Diff 30594.Jun 9 2020, 9:10 PM

change the API name

herb retitled this revision from efl_ui_textpath: add the efl_ui_textpath_text_user_style_push API for applying the user text style to efl_ui_textpath: add the efl_ui_textpath_text_user_style_set API for applying the user text style.Jun 9 2020, 9:12 PM
Hermet requested changes to this revision.Jun 9 2020, 9:19 PM

Please check comments.

src/lib/elementary/efl_ui_textpath.c
1053

char* text_part;

1055

else text_part = EFL_UI_TEXT_PART_NAME;

1057

if (pd->user_style)
{

edje_object... pop();
eina_strbuf_free();
pd->user_style = NULL;

}
if (!style) return;

1067

You don't need strbuf but use eina_stringshare

This revision now requires changes to proceed.Jun 9 2020, 9:19 PM
herb updated this revision to Diff 30596.Jun 9 2020, 10:49 PM

update codes based on comments

herb updated this revision to Diff 30597.Jun 9 2020, 10:50 PM

update comments

Harbormaster completed remote builds in B16957: Diff 30597.
herb updated this revision to Diff 30598.Jun 9 2020, 10:51 PM

update version

Hermet requested changes to this revision.Jun 9 2020, 11:06 PM
Hermet added inline comments.
src/lib/elementary/efl_ui_textpath.c
1066

please recover ellipsis behavior here.

src/lib/elementary/elm_textpath_legacy.h
23

> 1.25

This revision now requires changes to proceed.Jun 9 2020, 11:06 PM
herb updated this revision to Diff 30599.Jun 9 2020, 11:14 PM

update codes

herb edited the summary of this revision. (Show Details)Jun 9 2020, 11:18 PM
Hermet requested changes to this revision.Jun 9 2020, 11:31 PM

Last comment!

src/lib/elementary/efl_ui_textpath.c
1066

if (style)
{

pd->user_style = eina_strbuf_new();
eina_strbuf_append(pd->user_style, style);

edje_object_part_text_style_user_pop(pd->text_obj, text_part);
edje_object_part_text_style_user_push(pd->text_obj, text_part, eina_strbuf_string_get(pd->user_style));

}

This revision now requires changes to proceed.Jun 9 2020, 11:31 PM
herb updated this revision to Diff 30600.Jun 9 2020, 11:37 PM

clean up

Hermet accepted this revision.Jun 9 2020, 11:38 PM
This revision is now accepted and ready to land.Jun 9 2020, 11:38 PM
This revision was automatically updated to reflect the committed changes.