Page MenuHomePhabricator

elm_entry: handle cursor delete/backspace with clusters consist of one or multible glyphs
ClosedPublic

Authored by ali.alzyod on Aug 19 2019, 7:42 AM.

Details

Summary

Cluster consist of one glyph, expected to be removed on backspace or delete key.
Cluster consist of multible glyph, expectd to remove part of on backspace or delete key.

This is behaviour founded in Android. (our current way of handling similar to Qt)

New Behaviour

Old Behaviour

Test Plan

Auto Testing is challenging because there are no easy way to emulate keyboard down on elm_entry

#include <Elementary.h>

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win,*box,*entry;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("", "");
   elm_win_autodel_set(win, EINA_TRUE);

   box = elm_box_add(win);
   entry = elm_entry_add(box);

   evas_object_size_hint_weight_set(box,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(box,EVAS_HINT_FILL,EVAS_HINT_FILL);

   elm_entry_entry_set(entry,"<font=NotoColorEmoji wrap=mixed >🇧🇬อั🇧🇬อั&#x1F600;&#x1F600;&#x1F600;&#x1F600;&#x1F600;อั</font>");
   evas_object_size_hint_weight_set(entry,EVAS_HINT_EXPAND,0.9);
   evas_object_size_hint_align_set(entry,EVAS_HINT_FILL,EVAS_HINT_FILL);
   evas_object_show(entry);
   evas_object_show(box);
 
   elm_box_pack_end(box,entry);
   elm_win_resize_object_add(win,box);
   evas_object_resize(win,320,480);

   evas_object_size_hint_weight_set(entry,EVAS_HINT_EXPAND,0.1);
   evas_object_size_hint_align_set(entry,EVAS_HINT_FILL,EVAS_HINT_FILL);
   
   evas_object_show(win);
   elm_run();

   return 0;
}
ELM_MAIN()

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.
ali.alzyod created this revision.Aug 19 2019, 7:42 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

ali.alzyod requested review of this revision.Aug 19 2019, 7:42 AM
ali.alzyod edited the test plan for this revision. (Show Details)Aug 19 2019, 7:44 AM
ali.alzyod edited the summary of this revision. (Show Details)
ali.alzyod edited the test plan for this revision. (Show Details)Aug 19 2019, 8:25 AM
cedric added a reviewer: tasn.Aug 19 2019, 9:39 AM
tasn added a comment.Aug 19 2019, 1:50 PM

I haven't looked at the actual code, but I do plan on making textblock2 work on grapheme clusters too, so this is inline with that change.
Though maybe I'd wait with this until TB2 is in, hopefully in a few weeks?

In D9628#178653, @tasn wrote:

I haven't looked at the actual code, but I do plan on making textblock2 work on grapheme clusters too, so this is inline with that change.
Though maybe I'd wait with this until TB2 is in, hopefully in a few weeks?

@tasn
This one is for application bugs with legacy APIs, so - I'm wondering whether your plan with TB2 will effect legacy applications or not.
If not, I think this kinds of patch is necessary.

tasn added a comment.Aug 20 2019, 11:48 PM
In D9628#178653, @tasn wrote:

I haven't looked at the actual code, but I do plan on making textblock2 work on grapheme clusters too, so this is inline with that change.
Though maybe I'd wait with this until TB2 is in, hopefully in a few weeks?

@tasn
This one is for application bugs with legacy APIs, so - I'm wondering whether your plan with TB2 will effect legacy applications or not.
If not, I think this kinds of patch is necessary.

Gotcha, fair enough. :)

This revision was not accepted when it landed; it landed in state Needs Review.Sep 4 2019, 10:54 PM
This revision was automatically updated to reflect the committed changes.
woohyun reopened this revision.Sep 4 2019, 11:02 PM
woohyun accepted this revision.
This revision is now accepted and ready to land.Sep 4 2019, 11:02 PM
woohyun closed this revision.Sep 4 2019, 11:02 PM

This break compilation without harfbuzz.

This break compilation without harfbuzz.

Thank you, This will fix it D9845