genlist: re-focus on genlist in item focus set when sub-object was focused 12/146412/9
authorSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Mon, 28 Aug 2017 10:55:05 +0000 (19:55 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Mon, 11 Sep 2017 09:34:56 +0000 (09:34 +0000)
Change-Id: I6de90b593dc0e251bc401bdd245dcfb507a90a98
Signed-off-by: SangHyeon Jade Lee <dltkdgus1764@gmail.com>
src/lib/elm_genlist.c
src/mobile_lib/elm_genlist.c

index adf4e1b..1fe18fa 100644 (file)
@@ -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)
index 0a0c6d9..1c39b5a 100644 (file)
@@ -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)