diff options
author | Tom Hacohen <tom@stosb.com> | 2016-06-13 12:34:39 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2016-06-13 12:34:41 +0100 |
commit | 38d1f9e140f5c042b2d76dc02bee821e8cd36a2f (patch) | |
tree | a64c8f2a50032c3fb0bf755cfa20a787f93fb9c2 | |
parent | fdd2d5d9f76529693fbb6c9e226db70451da97f9 (diff) | |
download | efl-38d1f9e140f5c042b2d76dc02bee821e8cd36a2f.tar.gz |
Ui Text interactive: Remove selection,cleared signal, use changed instead.
If the selection cursors are equal, there's no selection, if they are
different, there is.
-rw-r--r-- | src/lib/elementary/efl_ui_internal_text_interactive.c | 17 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_text_interactive.eo | 4 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 7328bb6ad1..9e6af6ebcd 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -43,7 +43,6 @@ static void _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Interna static void _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en); static void _entry_imf_cursor_info_set(Evas_Textblock_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en); -static void _emit_sel_state(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en); #ifdef HAVE_ECORE_IMF static void @@ -509,8 +508,7 @@ static Eina_Bool _sel_cursor_changed(void *data, const Eo_Event *event EINA_UNUSED) { Efl_Canvas_Text_Cursor *obj = data; - Efl_Ui_Internal_Text_Interactive_Data *en = eo_data_scope_get(obj, MY_CLASS); - _emit_sel_state(obj, en); + eo_event_callback_call(obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL); return EO_CALLBACK_CONTINUE; } @@ -548,15 +546,6 @@ _sel_enable(Evas_Textblock_Cursor *c EINA_UNUSED, } static void -_emit_sel_state(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en) -{ - if (efl_canvas_text_cursor_equal(en->sel_start, en->sel_end)) - eo_event_callback_call(obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CLEARED, NULL); - else - eo_event_callback_call(obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL); -} - -static void _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en) { if (!en->sel_end) return; @@ -575,7 +564,7 @@ _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Inter } static void -_sel_clear(Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en) +_sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) { en->had_sel = EINA_FALSE; if (en->selection) @@ -587,7 +576,7 @@ _sel_clear(Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en) { en->have_selection = EINA_FALSE; - eo_event_callback_call(o, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CLEARED, NULL); + efl_canvas_text_cursor_copy(en->sel_start, en->sel_end); } } diff --git a/src/lib/elementary/efl_ui_text_interactive.eo b/src/lib/elementary/efl_ui_text_interactive.eo index fa66d42665..583d8418a4 100644 --- a/src/lib/elementary/efl_ui_text_interactive.eo +++ b/src/lib/elementary/efl_ui_text_interactive.eo @@ -25,6 +25,9 @@ interface Efl.Ui.Text.Interactive () @property selection_cursors { [[The cursors used for selection handling. + If the cursors are equal (@Efl.Canvas.Text.Cursor.equal), there is + no selection. + You are allowed to retain and modify them. Modifying them modifies the selection of the object. ]] @@ -46,6 +49,5 @@ interface Efl.Ui.Text.Interactive () events { changed,user: Efl.Ui.Text.Interactive.Change_Info; [[The text object has changed due to user interaction]] selection,changed; [[The selection on the object has changed. Query using @.selection_cursors]] - selection,cleared; [[The selection on the object has been cleared]] } } |