From 047e9c35f7acdfc898fa0d724b8261a70848dca0 Mon Sep 17 00:00:00 2001 From: Dave Andreoli Date: Sun, 24 Jan 2016 15:44:48 +0100 Subject: [PATCH] Reveal the same focus bug of previous commit also in genlist. See previous commit for instructions on how to reproduce in "Genlist Focus" test. --- legacy/elementary/src/bin/test_genlist.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/legacy/elementary/src/bin/test_genlist.c b/legacy/elementary/src/bin/test_genlist.c index 9dcebc19eb..2813c42713 100644 --- a/legacy/elementary/src/bin/test_genlist.c +++ b/legacy/elementary/src/bin/test_genlist.c @@ -4214,9 +4214,11 @@ gl_focus_top_items_text_get(void *data, Evas_Object *obj EINA_UNUSED, if (!strcmp(data, "do_nothing")) return strdup("Genlist Item"); else if (!strcmp(data, "popup_sel")) - return strdup("Create a popup on Select"); + return strdup("Create a popup on Select (popup parent is gl)"); else if (!strcmp(data, "popup_mouse_down")) - return strdup("Create a popup on Mouse Down"); + return strdup("Create a popup on Mouse Down (popup parent is gl)"); + else if (!strcmp(data, "popup_activate")) + return strdup("Create a popup on Activate (popup parent is win)"); else if (!strcmp(data, "clear_on_focus")) return strdup("Genlist Clear on Focus"); else @@ -4400,9 +4402,17 @@ _gl_focus_item_unfocus_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, } static void -_gl_focus_item_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +_gl_focus_item_cb(void *data, Evas_Object *obj, void *event_info) { - printf("%s: %p\n", (char *)data, event_info); + Elm_Object_Item *it = event_info; + + printf("%s: %p\n", (char *)data, it); + + if (!strcmp((char *)data, "activated") && + !strcmp((char *)elm_object_item_data_get(it), "popup_activate")) + { + _gl_focus_sel_popup_create(elm_object_top_widget_get(obj)); + } } static void @@ -4896,6 +4906,8 @@ test_genlist_focus(void *data EINA_UNUSED, _gl_focus_0_item_sel_cb, NULL); elm_genlist_item_append(gl, itc, "popup_mouse_down", NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_append(gl, itc, "popup_activate", NULL, ELM_GENLIST_ITEM_NONE, + NULL, NULL); it = elm_genlist_item_append(gl, itc, "clear_on_focus", NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);