[access] unfocusable object could have highlight
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 4 Jul 2013 02:19:12 +0000 (11:19 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Mon, 8 Jul 2013 06:47:22 +0000 (15:47 +0900)
Change-Id: Ibf5b82c023a42e53da4b9e08e9969785118eba7b

src/lib/elm_access.c
src/lib/elm_conform.c
src/lib/elm_widget.c

index 44d8ca7..6816084 100644 (file)
@@ -40,8 +40,6 @@ _elm_access_smart_add(Evas_Object *obj)
 {
    EVAS_SMART_DATA_ALLOC(obj, Elm_Widget_Smart_Data);
    ELM_WIDGET_CLASS(_elm_access_parent_sc)->base.add(obj);
-
-   elm_widget_can_focus_set(obj, _elm_config->access_mode);
 }
 
 static Eina_Bool
@@ -141,12 +139,6 @@ _elm_access_smart_activate(Evas_Object *obj, Elm_Activate act)
 }
 
 static void
-_elm_access_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
-   elm_widget_can_focus_set(obj, is_access);
-}
-
-static void
 _elm_access_smart_set_user(Elm_Widget_Smart_Class *sc)
 {
    sc->base.add = _elm_access_smart_add;
@@ -156,7 +148,6 @@ _elm_access_smart_set_user(Elm_Widget_Smart_Class *sc)
    sc->focus_direction = NULL;
    sc->on_focus = _elm_access_smart_on_focus;
    sc->activate = _elm_access_smart_activate;
-   sc->access = _elm_access_smart_access;
 
    return;
 }
@@ -733,7 +724,7 @@ _access_highlight_next_get(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool
 }
 
 void
-_elm_access_all_read_stop()
+_elm_access_all_read_stop(void)
 {
    _access_init();
    if (mapi)
index ca118bd..9780824 100644 (file)
@@ -482,6 +482,9 @@ _create_portrait_indicator(Evas_Object *obj)
    evas_object_size_hint_min_set(port_indicator, -1, 0);
    evas_object_size_hint_max_set(port_indicator, -1, 0);
 
+   /* access - would use tree_highlight_allow_set(); */
+   elm_widget_tree_unfocusable_set(port_indicator, EINA_TRUE);
+
    return port_indicator;
 }
 
@@ -525,6 +528,10 @@ _create_landscape_indicator(Evas_Object *obj)
 
    evas_object_size_hint_min_set(land_indicator, -1, 0);
    evas_object_size_hint_max_set(land_indicator, -1, 0);
+
+   /* access - would use tree_highlight_allow_set(); */
+   elm_widget_tree_unfocusable_set(land_indicator, EINA_TRUE);
+
    return land_indicator;
 }
 
index aab5649..5173488 100644 (file)
@@ -2342,10 +2342,19 @@ elm_widget_focus_next_get(const Evas_Object *obj,
    API_ENTRY return EINA_FALSE;
 
    /* Ignore if disabled */
-   if ((!evas_object_visible_get(obj))
-       || (elm_widget_disabled_get(obj))
-       || (elm_widget_tree_unfocusable_get(obj)))
-     return EINA_FALSE;
+   if (_elm_config->access_mode && _elm_access_auto_highlight_get())
+     {
+        if (!evas_object_visible_get(obj)
+            || (elm_widget_tree_unfocusable_get(obj)))
+          return EINA_FALSE;
+     }
+   else
+     {
+        if ((!evas_object_visible_get(obj))
+            || (elm_widget_disabled_get(obj))
+            || (elm_widget_tree_unfocusable_get(obj)))
+          return EINA_FALSE;
+     }
 
    if (!sd->api) return EINA_FALSE;
 
@@ -2379,21 +2388,19 @@ elm_widget_focus_next_get(const Evas_Object *obj,
         return ret;
      }
 
-   if (!elm_widget_can_focus_get(obj))
-     return EINA_FALSE;
-
-   /* 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())
      {
         ac = _elm_access_object_get(obj);
         if (!ac) return EINA_FALSE;
 
         /* check whether the hover object is visible or not */
-        if (!evas_object_visible_get(ac->hoverobj)
-            || (elm_widget_disabled_get(ac->hoverobj))
-            || (elm_widget_tree_unfocusable_get(ac->hoverobj)))
+        if (!evas_object_visible_get(ac->hoverobj))
           return EINA_FALSE;
      }
+   else if (!elm_widget_can_focus_get(obj))
+     return EINA_FALSE;
 
    if (elm_widget_focus_get(obj))
      {