From f2f1c76639541a6fa817f294b3aaba57ad7ccca5 Mon Sep 17 00:00:00 2001 From: SangHyeon Jade Lee Date: Mon, 28 Aug 2017 19:55:05 +0900 Subject: [PATCH] genlist: re-focus on genlist in item focus set when sub-object was focused Change-Id: I6de90b593dc0e251bc401bdd245dcfb507a90a98 Signed-off-by: SangHyeon Jade Lee --- src/lib/elm_genlist.c | 16 ++++++++++++++++ src/mobile_lib/elm_genlist.c | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index adf4e1b..1fe18fa 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -6266,6 +6266,7 @@ EOLIAN static void _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool focused) { Evas_Object *obj = WIDGET(it); + Evas_Object *fobj; ELM_GENLIST_DATA_GET(obj, sd); if (focused) @@ -6277,6 +6278,21 @@ _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo if (!elm_widget_focus_get(obj)) return; + fobj = elm_object_focused_object_get(obj); + if (fobj && (fobj != obj)) + { + Evas_Object *content; + Eina_List *l; + EINA_LIST_FOREACH(it->contents, l, content) + { + if (elm_object_focused_object_get(content)) + { + elm_object_focus_set(content, EINA_FALSE); + break; + } + } + } + if (eo_it != sd->focused_item) { if (sd->focused_item) diff --git a/src/mobile_lib/elm_genlist.c b/src/mobile_lib/elm_genlist.c index 0a0c6d9..1c39b5a 100644 --- a/src/mobile_lib/elm_genlist.c +++ b/src/mobile_lib/elm_genlist.c @@ -4035,6 +4035,12 @@ _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item if (!elm_widget_focus_get(obj)) return; + if (sd->focused_content) + { + elm_object_focus_set(sd->focused_content, EINA_FALSE); + sd->focused_content = NULL; + } + if (it != sd->focused_item) { if (sd->focused_item) -- 2.7.4