genlist : fix content focused handle on focus
authorSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 13 Dec 2016 12:02:43 +0000 (21:02 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 05:37:08 +0000 (14:37 +0900)
when content object is getting focused,
genlist object should not process on focus.

Change-Id: I18d5b0d6298b3fe5edc97ad1b0627fc4d2f8af28
Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
src/mobile_lib/elm_genlist.c

index e9b2f6b0339efd9e65ea33a1a7170cfc7d15d890..2adbfa811f30d2e246a8acdedbdbb722764d2ece 100644 (file)
@@ -919,6 +919,16 @@ _item_content_realize(Elm_Gen_Item *it,
 
         snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
         edje_object_signal_emit(target, buf, "elm");
+
+        // If content object is focused,
+        // genlist item should be focused.
+        if (elm_widget_focused_object_get(content))
+          {
+             if (GL_IT(it)->wsd->focused_item != it)
+               elm_object_item_focus_set(it, EINA_TRUE);
+
+             GL_IT(it)->wsd->focused_content = content;
+          }
 out:
         if (old && content != old)
           {
@@ -3871,35 +3881,6 @@ _elm_genlist_elm_widget_on_focus(Eo *obj, Elm_Genlist_Data *sd, Elm_Object_Item
              else
                elm_object_focus_set(sd->focused_content, EINA_TRUE);
           }
-        else if (elm_widget_focused_object_get(obj) &&
-                 (obj != elm_widget_focused_object_get(obj)))
-          {
-             Item_Block *itb, *nib;
-             Eina_List *l, *ll;
-             Evas_Object *content = NULL;
-             Elm_Gen_Item *it;
-             EINA_INLIST_FOREACH(sd->blocks, itb)
-               {
-                  if (itb->realized)
-                    {
-                       EINA_LIST_FOREACH(itb->items, l, it)
-                         {
-                            EINA_LIST_FOREACH(it->content_objs, ll, content)
-                              {
-                                 if (elm_widget_focused_object_get(content))
-                                   {
-                                      sd->focused_item = it;
-                                      sd->focused_content = content;
-                                      goto success;
-                                   }
-                              }
-                         }
-
-                       nib = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(itb)->next, Item_Block);
-                       if (!nib || !nib->realized) goto fail;
-                    }
-               }
-          }
         else
           {
              Item_Block *itb, *nib;