scroller: set focus to focus next object when next object is outside the viewport 74/187374/2
authorJeonghyun Yun <jh0506.yun@samsung.com>
Wed, 22 Aug 2018 10:16:47 +0000 (19:16 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Fri, 24 Aug 2018 07:37:32 +0000 (07:37 +0000)
@tizen_fix
Change-Id: I43f245b1f9ccaabaa026e7bea33b8526c771d68a
Signed-off-by: Jeonghyun Yun <jh0506.yun@samsung.com>
src/lib/elm_scroller.c

index 1fec03a..d2ab3a4 100644 (file)
@@ -186,6 +186,24 @@ _key_action_move(Evas_Object *obj, const char *params)
              eina_list_free(can_focus_list);
              return EINA_TRUE;
           }
+        else if (!r)
+          {
+             if (!strcmp(dir, "left"))
+               new_focus = elm_object_focus_next_object_get(current_focus, ELM_FOCUS_LEFT);
+             else if (!strcmp(dir, "right"))
+               new_focus = elm_object_focus_next_object_get(current_focus, ELM_FOCUS_RIGHT);
+             else if (!strcmp(dir, "up"))
+               new_focus = elm_object_focus_next_object_get(current_focus, ELM_FOCUS_UP);
+             else if (!strcmp(dir, "down"))
+               new_focus = elm_object_focus_next_object_get(current_focus, ELM_FOCUS_DOWN);
+
+             if (new_focus)
+               {
+                  elm_widget_focus_steal(new_focus, NULL);
+                  eina_list_free(can_focus_list);
+                  return EINA_TRUE;
+               }
+          }
      }
 
    eina_list_free(can_focus_list);