summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2016-01-20 17:15:45 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-01-20 17:15:45 +0900
commit163d1c8b88fc613a4700cecc93f83f7136da0873 (patch)
treeefd7348ea9f5eb4c4607ac64cc29894c4042167b
parent89d072b8f2cb6b240b2dca1ace32594442a2df8e (diff)
elm_widget: use internal function for clearing the focus
Summary: This patch will remove duplicate logic Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Reviewers: seoz, Hermet, cedric Subscribers: seoz Differential Revision: https://phab.enlightenment.org/D3573
-rw-r--r--src/lib/elm_widget.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 11d4ee091..b779994dd 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -2914,10 +2914,9 @@ _elm_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
2914 return sd->parent_obj; 2914 return sd->parent_obj;
2915} 2915}
2916 2916
2917EOLIAN static void 2917static void
2918_elm_widget_focused_object_clear(Eo *obj, Elm_Widget_Smart_Data *sd) 2918_focused_object_clear(Elm_Widget_Smart_Data *sd)
2919{ 2919{
2920 if (!sd->focused) return;
2921 if (sd->resize_obj && elm_widget_is(sd->resize_obj) && 2920 if (sd->resize_obj && elm_widget_is(sd->resize_obj) &&
2922 elm_widget_focus_get(sd->resize_obj)) 2921 elm_widget_focus_get(sd->resize_obj))
2923 { 2922 {
@@ -2936,6 +2935,13 @@ _elm_widget_focused_object_clear(Eo *obj, Elm_Widget_Smart_Data *sd)
2936 } 2935 }
2937 } 2936 }
2938 } 2937 }
2938}
2939
2940EOLIAN static void
2941_elm_widget_focused_object_clear(Eo *obj, Elm_Widget_Smart_Data *sd)
2942{
2943 if (!sd->focused) return;
2944 _focused_object_clear(sd);
2939 sd->focused = EINA_FALSE; 2945 sd->focused = EINA_FALSE;
2940 eo_do(obj, elm_obj_widget_on_focus(NULL)); 2946 eo_do(obj, elm_obj_widget_on_focus(NULL));
2941} 2947}
@@ -2968,27 +2974,7 @@ _elm_widget_focus_steal(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item *ite
2968 if (!parent2) parent2 = elm_widget_parent2_get(parent); 2974 if (!parent2) parent2 = elm_widget_parent2_get(parent);
2969 parent = parent2; 2975 parent = parent2;
2970 sd = eo_data_scope_get(parent, MY_CLASS); 2976 sd = eo_data_scope_get(parent, MY_CLASS);
2971 if (sd) 2977 if (sd) _focused_object_clear(sd);
2972 {
2973 if (sd->resize_obj && elm_widget_is(sd->resize_obj) &&
2974 elm_widget_focus_get(sd->resize_obj))
2975 {
2976 eo_do(sd->resize_obj, elm_obj_widget_focused_object_clear());
2977 }
2978 else
2979 {
2980 const Eina_List *l;
2981 Evas_Object *child;
2982 EINA_LIST_FOREACH(sd->subobjs, l, child)
2983 {
2984 if (_elm_widget_is(child) && elm_widget_focus_get(child))
2985 {
2986 eo_do(child, elm_obj_widget_focused_object_clear());
2987 break;
2988 }
2989 }
2990 }
2991 }
2992 } 2978 }
2993 _parent_focus(obj, item); 2979 _parent_focus(obj, item);
2994 elm_widget_focus_region_show(obj); 2980 elm_widget_focus_region_show(obj);