diff options
author | Yeongjong Lee <cleanlyj@naver.com> | 2017-12-05 17:57:44 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-12-05 18:35:31 +0900 |
commit | 93492bcc3b466404d8c7df2e4fc205aa842f0d67 (patch) | |
tree | f8c03a928c3a350576188159cc9e40364e1aa386 | |
parent | f5001ca4f9d697beae396c6dde82dc95bfbb56b1 (diff) | |
download | efl-93492bcc3b466404d8c7df2e4fc205aa842f0d67.tar.gz |
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
-rw-r--r-- | src/lib/elementary/elm_widget.c | 55 |
1 files 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 |