elementary : child_can_focus should be EINA_FALSE only when all
authorWooHyun Jung <woohyun0705@gmail.com>
Thu, 31 May 2012 07:15:28 +0000 (07:15 +0000)
committerWooHyun Jung <woohyun0705@gmail.com>
Thu, 31 May 2012 07:15:28 +0000 (07:15 +0000)
children in the object tree were not focusable.

SVN revision: 71573

ChangeLog
src/lib/elm_widget.c

index 98cc092..7030db4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * Entry: Add 3 APIs which are elm_entry_text_style_user_push/pop/peek
        and test functions for these APIs.
+
+2012-05-31 WooHyun Jung
+
+       * child_can_focus should be EINA_FALSE only when all children in the object
+         tree are not focusable. Before this fix, it was EINA_FALSE when all sub
+         objects were not focusable. (i.e. didn't check whole object tree)
index 65e387c..b04deeb 100644 (file)
@@ -406,7 +406,16 @@ _elm_widget_sub_object_add_func(Evas_Object *obj,
              sdc->parent_obj = obj;
              _elm_widget_top_win_focused_set(sobj, sd->top_win_focused);
              if (!sd->child_can_focus && (_is_focusable(sobj)))
-               sd->child_can_focus = EINA_TRUE;
+               {
+                  Elm_Widget_Smart_Data *sdt = evas_object_smart_data_get(obj);
+                  sdt->child_can_focus = EINA_TRUE;
+                  while (sdt->parent_obj)
+                    {
+                       sdt = evas_object_smart_data_get(sdt->parent_obj);
+                       if (sdt->child_can_focus) break;
+                       sdt->child_can_focus = EINA_TRUE;
+                    }
+               }
           }
      }
    else
@@ -485,16 +494,21 @@ _elm_widget_sub_object_del_func(Evas_Object *obj,
           {
              Evas_Object *subobj;
              const Eina_List *l;
-
-             sd->child_can_focus = EINA_FALSE;
-
-             EINA_LIST_FOREACH (sd->subobjs, l, subobj)
+             Elm_Widget_Smart_Data *sdt = evas_object_smart_data_get(obj);
+             while (1)
                {
-                  if (_is_focusable(subobj))
+                  sdt->child_can_focus = EINA_FALSE;
+                  EINA_LIST_FOREACH(sdt->subobjs, l, subobj)
                     {
-                       sd->child_can_focus = EINA_TRUE;
-                       break;
+                       if ((subobj != sobj) && (_is_focusable(subobj)))
+                         {
+                            sdt->child_can_focus = EINA_TRUE;
+                            break;
+                         }
                     }
+                  if (sdt->child_can_focus) break;
+                  if (!sdt->parent_obj) break;
+                  sdt = evas_object_smart_data_get(sdt->parent_obj);
                }
           }
 
@@ -1505,7 +1519,16 @@ elm_widget_sub_object_add(Evas_Object *obj,
              sd2->parent_obj = obj;
              _elm_widget_top_win_focused_set(sobj, sd->top_win_focused);
              if (!sd->child_can_focus && (_is_focusable(sobj)))
-               sd->child_can_focus = EINA_TRUE;
+               {
+                  Elm_Widget_Smart_Data *sdt = evas_object_smart_data_get(obj);
+                  sdt->child_can_focus = EINA_TRUE;
+                  while (sdt->parent_obj)
+                    {
+                       sdt = evas_object_smart_data_get(sdt->parent_obj);
+                       if (sdt->child_can_focus) break;
+                       sdt->child_can_focus = EINA_TRUE;
+                    }
+               }
           }
      }
    else
@@ -1575,14 +1598,21 @@ elm_widget_sub_object_del(Evas_Object *obj,
           {
              Evas_Object *subobj;
              const Eina_List *l;
-             sd->child_can_focus = EINA_FALSE;
-             EINA_LIST_FOREACH(sd->subobjs, l, subobj)
+             Elm_Widget_Smart_Data *sdt = evas_object_smart_data_get(obj);
+             while (1)
                {
-                  if (_is_focusable(subobj))
+                  sdt->child_can_focus = EINA_FALSE;
+                  EINA_LIST_FOREACH(sdt->subobjs, l, subobj)
                     {
-                       sd->child_can_focus = EINA_TRUE;
-                       break;
+                       if ((subobj != sobj) && (_is_focusable(subobj)))
+                         {
+                            sdt->child_can_focus = EINA_TRUE;
+                            break;
+                         }
                     }
+                  if (sdt->child_can_focus) break;
+                  if (!sdt->parent_obj) break;
+                  sdt = evas_object_smart_data_get(sdt->parent_obj);
                }
           }
         Elm_Widget_Smart_Data *sd2 = evas_object_smart_data_get(sobj);