static void
_on_sub_obj_del(void *data, const Efl_Event *event);
static void _propagate_event(void *data, const Efl_Event *eo_event);
-static void _elm_widget_focus_tree_unfocusable_handle(Eo *obj);
static void _elm_widget_shadow_update(Efl_Ui_Widget *obj);
EFL_CALLBACKS_ARRAY_DEFINE(elm_widget_subitems_callbacks,
//
}
+
+static int
+_tree_unfocusable_counter_get(Eo *widget)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(widget, pd, -1);
+
+ return pd->tree_unfocusable;
+}
+
/**
* @internal
*
EAPI void
elm_widget_tree_unfocusable_set(Eo *obj, Eina_Bool tree_unfocusable)
{
- Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
- if (!sd) return;
+ Efl_Ui_Widget *subs;
+ Eina_List *n;
+ Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
+ if (!pd) return;
+ int distance, parent_counter = (pd->parent_obj ? _tree_unfocusable_counter_get(pd->parent_obj) : 0);
+
+ if (tree_unfocusable)
+ pd->tree_unfocusable ++;
+ else
+ pd->tree_unfocusable --;
+
+ distance = pd->disabled - parent_counter;
+
+ if ((distance < 0) || (distance > 1))
+ {
+ distance = MAX(MIN(tree_unfocusable, 1), 0);
+ pd->disabled = parent_counter + distance;
+ }
+
+ EINA_LIST_FOREACH(pd->subobjs, n, subs)
+ {
+ if (efl_isa(subs, EFL_UI_WIDGET_CLASS))
+ efl_ui_widget_disabled_set(subs, elm_widget_tree_unfocusable_get(obj));
+ }
- tree_unfocusable = !!tree_unfocusable;
- if (sd->tree_unfocusable == tree_unfocusable) return;
- sd->tree_unfocusable = tree_unfocusable;
- //TIZEN_ONLY(20180607): Restore legacy focus
- //_elm_widget_focus_tree_unfocusable_handle(obj);
- efl_ui_widget_focus_tree_unfocusable_handle(obj);
- //
//focus state eval on all children
- _elm_widget_full_eval_children(obj, sd);
+ _elm_widget_full_eval_children(obj, pd);
}
/**
}
}
-EOLIAN static void
-_efl_ui_widget_focus_tree_unfocusable_handle(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
-{
- if (!elm_widget_parent_get(obj))
- efl_ui_widget_focused_object_clear(obj);
- else
- _if_focused_revert(obj, EINA_TRUE);
-}
-
/*
* @internal
*