[access] unfocusable object could have highlight
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 10 Sep 2013 05:22:21 +0000 (14:22 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 10 Sep 2013 05:22:21 +0000 (14:22 +0900)
legacy/elementary/src/lib/elm_access.c
legacy/elementary/src/lib/elm_widget.c

index 4c8cf89..6623e34 100644 (file)
@@ -39,7 +39,6 @@ _elm_access_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
    eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
 
    elm_widget_sub_object_add(eo_parent_get(obj), obj);
-   elm_widget_can_focus_set(obj, _elm_config->access_mode);
 }
 
 static Eina_Bool
@@ -1414,14 +1413,6 @@ elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Eva
 }
 
 static void
-_elm_access_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
-{
-   Eina_Bool is_access = va_arg(*list, int);
-
-   elm_widget_can_focus_set(obj, is_access);
-}
-
-static void
 _class_constructor(Eo_Class *klass)
 {
    const Eo_Op_Func_Description func_desc[] = {
@@ -1431,7 +1422,6 @@ _class_constructor(Eo_Class *klass)
 
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_access_smart_on_focus),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_access_smart_activate),
-        EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_access_smart_access),
 
         EO_OP_FUNC_SENTINEL
    };
index cf008f8..71953ce 100644 (file)
@@ -2597,6 +2597,7 @@ elm_widget_focus_next_get(const Evas_Object *obj,
 static void
 _elm_widget_focus_next_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
 {
+   Elm_Access_Info *ac;
    Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
    Evas_Object **next = va_arg(*list, Evas_Object **);
    Eina_Bool *ret = va_arg(*list, Eina_Bool *);
@@ -2608,10 +2609,19 @@ _elm_widget_focus_next_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
    *next = NULL;
 
    /* Ignore if disabled */
-   if ((!evas_object_visible_get(obj))
-       || (elm_widget_disabled_get(obj))
-       || (elm_widget_tree_unfocusable_get(obj)))
-     return;
+   if (_elm_config->access_mode && _elm_access_auto_highlight_get())
+     {
+        if (!evas_object_visible_get(obj)
+            || (elm_widget_tree_unfocusable_get(obj)))
+          return;
+     }
+   else
+     {
+        if ((!evas_object_visible_get(obj))
+            || (elm_widget_disabled_get(obj))
+            || (elm_widget_tree_unfocusable_get(obj)))
+          return;
+     }
 
    /* Try use hook */
    if (_elm_widget_focus_chain_manager_is(obj))
@@ -2645,16 +2655,19 @@ _elm_widget_focus_next_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
         return;
      }
 
-   if (!elm_widget_can_focus_get(obj))
-     return;
-
-   /* focusable object but does not have access info */
-   if (_elm_config->access_mode)
+   /* access object does not check sd->can_focus, because an object could
+      have highlight even though the object is not focusable. */
+   if (_elm_config->access_mode && _elm_access_auto_highlight_get())
      {
-        Elm_Access_Info *ac;
-        ac= _elm_access_info_get(obj);
+        ac = _elm_access_info_get(obj);
         if (!ac) return;
+
+        /* check whether the hover object is visible or not */
+        if (!evas_object_visible_get(ac->hoverobj))
+          return;
      }
+   else if (!elm_widget_can_focus_get(obj))
+     return;
 
    if (elm_widget_focus_get(obj))
      {