[access] unfocusable object could have highlight

This commit is contained in:
Shinwoo Kim 2013-09-10 14:22:21 +09:00
parent 34de4d619d
commit 3359ff5be5
2 changed files with 24 additions and 21 deletions

View 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
@ -1413,14 +1412,6 @@ elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Eva
ERR("Not supported focus direction for access highlight [%d]", dir);
}
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)
{
@ -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
};

View 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))
{