aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-07 12:42:00 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-02-07 12:42:00 +0100
commit4f9abba44049561d31e81ccdfddb4b9c3feae017 (patch)
tree7f8c8ad2ae5deef441c796458376ca348aa785a1
parentefl_ui_text: forward EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED event (diff)
downloadefl-4f9abba44049561d31e81ccdfddb4b9c3feae017.tar.gz
efl_ui_text: emit EFL_UI_TEXT_EVENT_CHANGED_USER from paste + drop operations
Summary: this is a user-triggered change so it must emit the event ref https://phab.enlightenment.org/T6979 Depends on https://phab.enlightenment.org/D7886 Reviewers: bu5hm4n, cedric, segfaultxavi Subscribers: #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: https://phab.enlightenment.org/T6979 Differential Revision: https://phab.enlightenment.org/D7887
-rw-r--r--src/lib/elementary/efl_ui_text.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index d30c721bbf..806c2b44b7 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -599,8 +599,10 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
Efl_Ui_Selection_Data *sel_data)
{
Efl_Text_Cursor_Cursor *cur, *start, *end;
+ Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 };
char *buf = eina_slice_strdup(sel_data->content);
+ size_t len = sel_data->content.len;
efl_text_interactive_selection_cursors_get(obj, &start, &end);
if (!efl_text_cursor_equal(obj, start, end))
@@ -608,6 +610,10 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
efl_canvas_text_range_delete(obj, start, end);
}
cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
+ info.insert = EINA_TRUE;
+ info.position = efl_text_cursor_position_get(obj, cur);
+ info.length = len;
+ info.content = buf;
if (sel_data->format == EFL_UI_SELECTION_FORMAT_MARKUP)
{
efl_text_markup_interactive_cursor_markup_insert(obj, cur, buf);
@@ -616,6 +622,7 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
{
efl_text_cursor_text_insert(obj, cur, buf);
}
+ efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
free(buf);
}