From: Ali Alzyod Date: Mon, 6 May 2019 12:01:24 +0000 (+0200) Subject: efl_ui_text: clear selection after cut X-Git-Tag: accepted/tizen/unified/20190509.041000~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8493c402de58705d8bc900e03a55f8e9e6b2de02;p=platform%2Fupstream%2Fefl.git efl_ui_text: clear selection after cut Test Plan: ``` #define EFL_EO_API_SUPPORT 1 #define EFL_BETA_API_SUPPORT 1 #include #include #include static void _gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { efl_exit(0); } static void _gui_setup() { Eo *win, *box; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Hello World"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); // when the user clicks "close" on a window there is a request to delete efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL); box = efl_add(EFL_UI_BOX_CLASS, win, efl_content_set(win, efl_added), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240))); efl_add(EFL_UI_TEXT_CLASS, box, efl_text_markup_set(efl_added, "Hello World.This is an Efl.Ui application!"), efl_text_interactive_selection_allowed_set(efl_added, EINA_TRUE), efl_text_multiline_set(efl_added,EINA_TRUE), efl_gfx_hint_weight_set(efl_added, 1.0, 0.9), efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_pack(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Quit"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.1), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _gui_quit_cb, efl_added)); } EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { _gui_setup(); } EFL_MAIN() ``` Reviewers: woohyun, bowonryu, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8833 --- diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index ebb2dd5..b92df12 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -1231,6 +1231,7 @@ _cut_cb(Eo *obj) _selection_store(EFL_UI_SELECTION_TYPE_CLIPBOARD, obj); efl_text_interactive_selection_cursors_get(obj, &start, &end); efl_canvas_text_range_delete(obj, start, end); + _efl_ui_text_select_none(obj, sd); } static void