jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=93492bcc3b466404d8c7df2e4fc205aa842f0d67

commit 93492bcc3b466404d8c7df2e4fc205aa842f0d67
Author: Yeongjong Lee <clean...@naver.com>
Date:   Tue Dec 5 17:57:44 2017 +0900

    elm_widget: simplify _eval_registration_candidate
    
    Test Plan: make check
    
    Reviewers: bu5hm4n, jpeg
    
    Reviewed By: jpeg
    
    Subscribers: cedric, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D5588
---
 src/lib/elementary/elm_widget.c | 55 +++++++++++------------------------------
 1 file changed, 14 insertions(+), 41 deletions(-)

diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 7c0289ec24..6b9f920a48 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -391,49 +391,22 @@ _eval_registration_candidate(Eo *obj, 
Elm_Widget_Smart_Data *pd, Eina_Bool *shou
 {
    *should = *want_full = EINA_FALSE;
 
+    //can focus can be overridden by the following properties
+    if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS) ||
+        (!pd->parent_obj) ||
+        (_tree_unfocusable(obj)) ||
+        (_tree_disabled(obj)) ||
+        (!evas_object_visible_get(obj)))
+      return;
+
     if (pd->can_focus)
       {
-        *should = EINA_TRUE;
-        //can focus can be overridden by the following properties
-
-        if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS))
-          *should = EINA_FALSE;
-
-        if (!pd->parent_obj)
-          *should = EINA_FALSE;
-
-        if (_tree_unfocusable(obj))
-          *should = EINA_FALSE;
-
-        if (_tree_disabled(obj))
-          *should = EINA_FALSE;
-
-        if (!evas_object_visible_get(obj))
-          *should = EINA_FALSE;
-
-        if (*should)
-          *want_full = EINA_TRUE;
-     }
-
-   if (!*should && pd->logical.child_count > 0)
-     {
-        *should = EINA_TRUE;
-
-        if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS))
-          *should = EINA_FALSE;
-
-        if (!pd->parent_obj)
-          *should = EINA_FALSE;
-
-        if (_tree_unfocusable(obj))
-          *should = EINA_FALSE;
-
-        if (_tree_disabled(obj))
-          *should = EINA_FALSE;
-
-        if (!evas_object_visible_get(obj))
-          *should = EINA_FALSE;
-     }
+         *should = *want_full = EINA_TRUE;
+      }
+    else if (pd->logical.child_count > 0)
+      {
+         *should = EINA_TRUE;
+      }
 }
 
 static void

-- 


Reply via email to