summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/benchmarks/elementary/item_container.c2
-rw-r--r--src/lib/elementary/efl_ui_widget.c56
-rw-r--r--src/lib/elementary/elm_widget.h2
3 files changed, 41 insertions, 19 deletions
diff --git a/src/benchmarks/elementary/item_container.c b/src/benchmarks/elementary/item_container.c
index 982df1df81..e8369d252f 100644
--- a/src/benchmarks/elementary/item_container.c
+++ b/src/benchmarks/elementary/item_container.c
@@ -76,7 +76,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
76 efl_ui_collection_position_manager_set(efl_added, list)); 76 efl_ui_collection_position_manager_set(efl_added, list));
77 efl_content_set(win, item_container); 77 efl_content_set(win, item_container);
78 78
79 printf("Building 5000 objects\n"); 79 printf("Building 5000 objects %d\n", getpid());
80 for (int i = 0; i < 5000; ++i) 80 for (int i = 0; i < 5000; ++i)
81 { 81 {
82 Eo *il = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, item_container); 82 Eo *il = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, item_container);
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index e99465b856..ab9e80e9c7 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -184,7 +184,6 @@ _elm_scrollable_is(const Evas_Object *obj)
184static void 184static void
185_on_sub_obj_del(void *data, const Efl_Event *event); 185_on_sub_obj_del(void *data, const Efl_Event *event);
186static void _propagate_event(void *data, const Efl_Event *eo_event); 186static void _propagate_event(void *data, const Efl_Event *eo_event);
187static void _elm_widget_focus_tree_unfocusable_handle(Eo *obj);
188static void _elm_widget_shadow_update(Efl_Ui_Widget *obj); 187static void _elm_widget_shadow_update(Efl_Ui_Widget *obj);
189 188
190EFL_CALLBACKS_ARRAY_DEFINE(elm_widget_subitems_callbacks, 189EFL_CALLBACKS_ARRAY_DEFINE(elm_widget_subitems_callbacks,
@@ -273,7 +272,10 @@ _candidacy_exam(Eo *obj)
273 Elm_Widget_Smart_Data *wid_pd; 272 Elm_Widget_Smart_Data *wid_pd;
274 273
275 wid_pd = efl_data_scope_get(wid, MY_CLASS); 274 wid_pd = efl_data_scope_get(wid, MY_CLASS);
276 do { 275
276 if (wid_pd->disabled > 0) return EINA_TRUE;
277 if (wid_pd->tree_unfocusable > 0) return EINA_TRUE;
278/* do {
277 279
278 if (wid_pd->disabled) return EINA_TRUE; 280 if (wid_pd->disabled) return EINA_TRUE;
279 if (wid_pd->tree_unfocusable) return EINA_TRUE; 281 if (wid_pd->tree_unfocusable) return EINA_TRUE;
@@ -293,9 +295,9 @@ _candidacy_exam(Eo *obj)
293 } 295 }
294 } 296 }
295 297
296 } while (1); 298 } while (1);*/
297 299
298 return !efl_isa(top, EFL_UI_WIN_CLASS); 300 return EINA_FALSE;
299} 301}
300 302
301static void _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd); 303static void _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd);
@@ -1675,6 +1677,15 @@ elm_widget_child_can_focus_get(const Eo *obj)
1675 return sd->logical.child_count > 0; 1677 return sd->logical.child_count > 0;
1676} 1678}
1677 1679
1680
1681static int
1682_tree_unfocusable_counter_get(Eo *widget)
1683{
1684 ELM_WIDGET_DATA_GET_OR_RETURN(widget, pd, -1);
1685
1686 return pd->tree_unfocusable;
1687}
1688
1678/** 1689/**
1679 * @internal 1690 * @internal
1680 * 1691 *
@@ -1693,16 +1704,33 @@ elm_widget_child_can_focus_get(const Eo *obj)
1693EAPI void 1704EAPI void
1694elm_widget_tree_unfocusable_set(Eo *obj, Eina_Bool tree_unfocusable) 1705elm_widget_tree_unfocusable_set(Eo *obj, Eina_Bool tree_unfocusable)
1695{ 1706{
1696 Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); 1707 Efl_Ui_Widget *subs;
1697 if (!sd) return; 1708 Eina_List *n;
1709 Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
1710 if (!pd) return;
1711 int distance, parent_counter = (pd->parent_obj ? _tree_unfocusable_counter_get(pd->parent_obj) : 0);
1698 1712
1699 tree_unfocusable = !!tree_unfocusable; 1713 if (tree_unfocusable)
1700 if (sd->tree_unfocusable == tree_unfocusable) return; 1714 pd->tree_unfocusable ++;
1701 sd->tree_unfocusable = tree_unfocusable; 1715 else
1702 _elm_widget_focus_tree_unfocusable_handle(obj); 1716 pd->tree_unfocusable --;
1717
1718 distance = pd->disabled - parent_counter;
1719
1720 if ((distance < 0) || (distance > 1))
1721 {
1722 distance = MAX(MIN(tree_unfocusable, 1), 0);
1723 pd->disabled = parent_counter + distance;
1724 }
1725
1726 EINA_LIST_FOREACH(pd->subobjs, n, subs)
1727 {
1728 if (efl_isa(subs, EFL_UI_WIDGET_CLASS))
1729 efl_ui_widget_disabled_set(subs, elm_widget_tree_unfocusable_get(obj));
1730 }
1703 1731
1704 //focus state eval on all children 1732 //focus state eval on all children
1705 _elm_widget_full_eval_children(obj, sd); 1733 _elm_widget_full_eval_children(obj, pd);
1706} 1734}
1707 1735
1708/** 1736/**
@@ -2910,12 +2938,6 @@ elm_widget_focus_mouse_up_handle(Eo *obj)
2910 } 2938 }
2911} 2939}
2912 2940
2913static void
2914_elm_widget_focus_tree_unfocusable_handle(Eo *obj EINA_UNUSED)
2915{
2916 //FIXME
2917}
2918
2919/* 2941/*
2920 * @internal 2942 * @internal
2921 * 2943 *
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index dfdfdb83f7..68b45ca8d3 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -355,6 +355,7 @@ typedef struct _Elm_Widget_Smart_Data
355 int child_drag_x_locked; 355 int child_drag_x_locked;
356 int child_drag_y_locked; 356 int child_drag_y_locked;
357 int disabled; 357 int disabled;
358 int tree_unfocusable;
358 359
359 Eina_Inlist *translate_strings; 360 Eina_Inlist *translate_strings;
360 Eina_List *focus_chain; 361 Eina_List *focus_chain;
@@ -397,7 +398,6 @@ typedef struct _Elm_Widget_Smart_Data
397 Eina_Bool can_focus : 1; 398 Eina_Bool can_focus : 1;
398 Eina_Bool focused : 1; 399 Eina_Bool focused : 1;
399 Eina_Bool top_win_focused : 1; 400 Eina_Bool top_win_focused : 1;
400 Eina_Bool tree_unfocusable : 1;
401 Eina_Bool focus_move_policy_auto_mode : 1; /* This is TRUE by default */ 401 Eina_Bool focus_move_policy_auto_mode : 1; /* This is TRUE by default */
402 Eina_Bool highlight_ignore : 1; 402 Eina_Bool highlight_ignore : 1;
403 Eina_Bool highlight_in_theme : 1; 403 Eina_Bool highlight_in_theme : 1;