From: Daniel Hirt Date: Thu, 3 Dec 2015 08:12:11 +0000 (+0200) Subject: Edje entry: emit "selection,reset" X-Git-Tag: upstream/1.20.0~8022 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5322575ba631f9f89c6f1b901064c65a726bb895;p=platform%2Fupstream%2Fefl.git Edje entry: emit "selection,reset" Adding a check for the selection range on extend/preextend. If there is no range, then emit "selection,reset". Expected handling on the theme end for this signal is to show the cursor. This improves cursor visuals, as it will show the cursor again once the selection range ends up being 0. --- diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index c9b424c..7c6c864 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -573,6 +573,19 @@ _sel_enable(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, } static void +_emit_sel_state(Edje *ed, Entry *en) +{ + if (!evas_textblock_cursor_compare(en->sel_start, en->sel_end)) + { + _edje_emit(ed, "selection,reset", en->rp->part->name); + } + else + { + _edje_emit(ed, "selection,changed", en->rp->part->name); + } +} + +static void _sel_extend(Edje *ed, Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) { if (!en->sel_end) return; @@ -588,7 +601,7 @@ _sel_extend(Edje *ed, Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) free(en->selection); en->selection = NULL; } - _edje_emit(ed, "selection,changed", en->rp->part->name); + _emit_sel_state(ed, en); } static void @@ -607,7 +620,7 @@ _sel_preextend(Edje *ed, Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) free(en->selection); en->selection = NULL; } - _edje_emit(ed, "selection,changed", en->rp->part->name); + _emit_sel_state(ed, en); } static void