summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-07 12:41:52 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-02-07 12:41:52 +0100
commit765fad936ba3b2e4cbe24a91d3e21dfb2707129f (patch)
treef95b704ad7f072d525b3d07ae91d76dd7b877299
parentd7d33b9fe4f86b29df00c5a0c7101999411f14e9 (diff)
efl_ui_text: emit EFL_UI_TEXT_EVENT_CHANGED events properly
Summary: these should be emitted any time text is changed in the object fix T7615, T7417, T6978, T6979 Depends on D7883 Reviewers: bu5hm4n, cedric, segfaultxavi Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: T7615, T7417, T6979, T6978 Differential Revision: https://phab.enlightenment.org/D7884
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c4
-rw-r--r--src/lib/elementary/efl_ui_text.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 7975cb58df..70571a94e5 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -607,6 +607,7 @@ _range_del_emit(Evas_Object *obj, Efl_Text_Cursor_Cursor *cur1, Efl_Text_Cursor_
607 evas_textblock_cursor_range_delete(cur1, cur2); 607 evas_textblock_cursor_range_delete(cur1, cur2);
608 608
609 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 609 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
610 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
610 if (tmp) free(tmp); 611 if (tmp) free(tmp);
611} 612}
612 613
@@ -637,6 +638,7 @@ _delete_emit(Eo *obj, Evas_Textblock_Cursor *c, Efl_Ui_Internal_Text_Interactive
637 evas_textblock_cursor_char_delete(c); 638 evas_textblock_cursor_char_delete(c);
638 639
639 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 640 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
641 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
640 if (tmp) free(tmp); 642 if (tmp) free(tmp);
641} 643}
642 644
@@ -1061,6 +1063,8 @@ end:
1061 if (changed_user) 1063 if (changed_user)
1062 { 1064 {
1063 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 1065 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
1066 /* FIXME: this is kinda gross */
1067 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
1064 } 1068 }
1065 (void) 0; 1069 (void) 0;
1066} 1070}
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 5f96f34eda..3be96644a4 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -2120,6 +2120,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
2120 elm_widget_sub_object_parent_add(obj); 2120 elm_widget_sub_object_parent_add(obj);
2121 2121
2122 text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj); 2122 text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj);
2123 efl_event_callback_forwarder_add(text_obj, EFL_UI_TEXT_EVENT_CHANGED, obj);
2123 sd->text_obj = text_obj; 2124 sd->text_obj = text_obj;
2124 sd->text_guide_obj = efl_add(EFL_CANVAS_TEXT_CLASS, obj); 2125 sd->text_guide_obj = efl_add(EFL_CANVAS_TEXT_CLASS, obj);
2125 sd->text_table = efl_add(EFL_UI_TABLE_CLASS, obj); 2126 sd->text_table = efl_add(EFL_UI_TABLE_CLASS, obj);
@@ -3892,13 +3893,14 @@ _decoration_defer_all(Eo *obj)
3892} 3893}
3893 3894
3894static void 3895static void
3895_efl_ui_text_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) 3896_efl_ui_text_changed_cb(void *data, const Efl_Event *event)
3896{ 3897{
3897 if (efl_invalidated_get(event->object)) return; 3898 if (efl_invalidated_get(event->object)) return;
3898 EFL_UI_TEXT_DATA_GET(data, sd); 3899 EFL_UI_TEXT_DATA_GET(data, sd);
3899 sd->text_changed = EINA_TRUE; 3900 sd->text_changed = EINA_TRUE;
3900 sd->cursor_update = EINA_TRUE; 3901 sd->cursor_update = EINA_TRUE;
3901 _update_guide_text(data, sd); 3902 _update_guide_text(data, sd);
3903 efl_event_callback_call(event->object, EFL_UI_TEXT_EVENT_CHANGED, NULL);
3902 elm_layout_sizing_eval(data); 3904 elm_layout_sizing_eval(data);
3903 _decoration_defer(data); 3905 _decoration_defer(data);
3904} 3906}