summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <sh10233.lee@samsung.com>2018-04-24 14:29:25 +0900
committerSangHyeon Lee <sh10233.lee@samsung.com>2018-04-24 14:29:25 +0900
commit2005be2d7ac07608ecb6ba9698bd4bc59d5439fc (patch)
tree101ec1ce9c908e46ece96ff81d76892315454a89
parent99abf1bf89b1ba86efb71b1d39b9f6f0a6e09acc (diff)
downloadefl-2005be2d7ac07608ecb6ba9698bd4bc59d5439fc.tar.gz
Revert "elm_genlist: for now disable this code"
This reverts commit a38f5c38921e16cd87d67dbd5cb3d0402edee4a3.
-rw-r--r--src/lib/elementary/elm_genlist.c65
-rw-r--r--src/lib/elementary/elm_genlist.eo3
2 files changed, 66 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 7f9c480846..b4aa295fb6 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -2963,7 +2963,6 @@ _elm_genlist_item_content_focus_set(Elm_Gen_Item *it, Elm_Focus_Direction dir)
EINA_LIST_FOREACH(it->item_focus_chain, l, focused_obj)
if (elm_object_focus_get(focused_obj)) break;
- /* FOCUS-FIXME
if (focused_obj && (dir != ELM_FOCUS_PREVIOUS))
{
Evas_Object *nextfocus;
@@ -2977,7 +2976,6 @@ _elm_genlist_item_content_focus_set(Elm_Gen_Item *it, Elm_Focus_Direction dir)
return;
}
}
- */
if (!l) l = it->item_focus_chain;
@@ -3435,6 +3433,69 @@ _elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd)
static Eina_Bool _elm_genlist_smart_focus_next_enable = EINA_FALSE;
+EOLIAN static Eina_Bool
+_elm_genlist_efl_ui_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Genlist_Data *_pd EINA_UNUSED)
+{
+ return _elm_genlist_smart_focus_next_enable;
+}
+
+EOLIAN static Eina_Bool
+_elm_genlist_efl_ui_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Genlist_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_genlist_efl_ui_widget_focus_next(Eo *obj, Elm_Genlist_Data *sd, Elm_Focus_Direction dir, Evas_Object **next, Elm_Object_Item **next_item)
+{
+ Evas_Coord x, y, w, h;
+ Evas_Coord sx, sy, sw, sh;
+ Item_Block *itb;
+ Eina_List *items = NULL;
+ Eina_Bool done = EINA_FALSE;
+ int ret;
+
+ evas_object_geometry_get(sd->obj, &sx, &sy, &sw, &sh);
+
+ EINA_INLIST_FOREACH(sd->blocks, itb)
+ {
+ if (itb->realized)
+ {
+ Eina_List *l;
+ Elm_Gen_Item *it;
+
+ done = EINA_TRUE;
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+ if (it->realized)
+ {
+ evas_object_geometry_get(it->base->view, &x, &y, &w, &h);
+
+ /* check item which displays more than half of its size */
+ if (it->base->access_obj &&
+ ELM_RECTS_INTERSECT
+ (x + (w / 2), y + (h / 2), 0, 0, sx, sy, sw, sh))
+ items = eina_list_append(items, it->base->access_obj);
+
+ if (!it->base->access_order) continue;
+
+ Eina_List *subl;
+ Evas_Object *subo;
+ EINA_LIST_FOREACH(it->base->access_order, subl, subo)
+ items = eina_list_append(items, subo);
+ }
+ }
+ }
+ else if (done) break;
+ }
+
+ ret = efl_ui_widget_focus_list_next_get
+ (obj, items, eina_list_data_get, dir, next, next_item);
+ eina_list_free(items);
+
+ return ret;
+}
+
static void
_mirrored_set(Evas_Object *obj,
Eina_Bool rtl)
diff --git a/src/lib/elementary/elm_genlist.eo b/src/lib/elementary/elm_genlist.eo
index ae01e70a7d..7428dd38f0 100644
--- a/src/lib/elementary/elm_genlist.eo
+++ b/src/lib/elementary/elm_genlist.eo
@@ -533,10 +533,13 @@ class Elm.Genlist (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll
Efl.Canvas.Group.group_member_add;
Efl.Object.provider_find;
Efl.Ui.Widget.theme_apply;
+ Efl.Ui.Widget.focus_next_manager_is;
Efl.Ui.Widget.widget_sub_object_add;
Efl.Ui.Widget.on_access_update;
Efl.Ui.Widget.focus_highlight_geometry { get; }
+ Efl.Ui.Widget.focus_next;
Efl.Ui.Focus.Object.on_focus_update;
+ Efl.Ui.Widget.focus_direction_manager_is;
Efl.Ui.Widget.widget_sub_object_del;
Efl.Ui.Widget.widget_event;
Efl.Ui.Widget.focused_item { get; }