aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-03-11 21:08:42 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-03-15 15:39:12 +0100
commit02a062ba673ef19aaeb4a78d90458786a578284a (patch)
tree743e051734322b7cde12d17129bca13da09ec63f
parentelm_genlist: move focus recovering to first_touch instead of (diff)
downloadefl-02a062ba673ef19aaeb4a78d90458786a578284a.tar.gz
elm_genlist: support immidiate focus once the item is realized
this supports the case of item.focus = true before the item is realized.
-rw-r--r--src/lib/elementary/elm_genlist.c21
-rw-r--r--src/lib/elementary/elm_widget_genlist.h1
2 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 16f51c7b06..ff361b8cb1 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -2046,6 +2046,15 @@ _item_realize(Elm_Gen_Item *it, const int index, Eina_Bool calc)
if (it->decorate_it_set) _decorate_item_set(it);
edje_object_message_signal_process(VIEW(it));
+
+ if (sd->focus_on_realization == it)
+ {
+ _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
+ _elm_widget_highlight_in_theme_update(WIDGET(it));
+ _elm_widget_focus_highlight_start(WIDGET(it));
+ efl_ui_focus_manager_focus_set(WIDGET(it), EO_OBJ(it));
+ sd->focus_on_realization = NULL;
+ }
}
static void
@@ -3401,7 +3410,8 @@ _elm_genlist_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Genlist_Data
elm_object_item_focus_set(eo_it, EINA_TRUE);
_elm_widget_focus_highlight_start(obj);
//set it again in the manager, there might be the case that the manager focus history and internal item foused logic are in different states
- efl_ui_focus_manager_focus_set(obj, eo_it);
+ if (efl_ui_focus_manager_request_subchild(obj, eo_it))
+ efl_ui_focus_manager_focus_set(obj, eo_it);
}
}
}
@@ -6149,16 +6159,19 @@ _elm_genlist_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Ei
_elm_genlist_item_unfocused(sd->focused_item);
_elm_genlist_item_focused(eo_it);
- efl_ui_focus_manager_focus_set(it->base->widget, eo_it);
-
/* If item is not realized state, widget couldn't get focus_highlight data. */
if (it->realized)
{
_elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
_elm_widget_highlight_in_theme_update(obj);
_elm_widget_focus_highlight_start(obj);
+ efl_ui_focus_manager_focus_set(it->base->widget, eo_it);
+ sd->focus_on_realization = NULL;
+ }
+ else
+ {
+ sd->focus_on_realization = it;
}
- efl_ui_focus_manager_focus_set(it->base->widget, eo_it);
}
}
else
diff --git a/src/lib/elementary/elm_widget_genlist.h b/src/lib/elementary/elm_widget_genlist.h
index fd4b68ac44..12f98d556d 100644
--- a/src/lib/elementary/elm_widget_genlist.h
+++ b/src/lib/elementary/elm_widget_genlist.h
@@ -151,6 +151,7 @@ struct _Elm_Genlist_Data
Eina_Hash *content_item_map;
Eo *provider;
+ Elm_Gen_Item *focus_on_realization;
Eina_Bool filter;
Eina_Bool focus_on_selection_enabled : 1;