diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-07-04 17:22:11 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-07-04 18:10:38 +0900 |
commit | b8fd5e875ab67cd76467d2fdb52130aff14d4dfd (patch) | |
tree | ee6db896a2ff485546dc49ee3fed8eadf4e1fc51 | |
parent | 8fb3fc166f2e518ec5ed4a0405eb4ded18227255 (diff) | |
download | efl-b8fd5e875ab67cd76467d2fdb52130aff14d4dfd.tar.gz |
test: Fix strange black rectangle in a test case
elementary_test -to "Entry on Page Scroll"
Click on "Click this and close popup"
A weird rectangle would be temporarily visible while the
popup is fading in. The rectangle was the block_events
rectangle. By default, elm_popup blocks events, and its
parent must be the whole blocked input area. This fixes the
parent in the example.
I think the block_events region should be fading in and out
as well, because it looks terrible right now.
Note: this changes the position of the popup, but makes
the whole "block_events" thing actually work (avoiding
other render artifacts).
-rw-r--r-- | src/bin/elementary/test_entry.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/bin/elementary/test_entry.c b/src/bin/elementary/test_entry.c index 9774f20f4d..b94c525c12 100644 --- a/src/bin/elementary/test_entry.c +++ b/src/bin/elementary/test_entry.c @@ -685,11 +685,17 @@ test_entry_scrolled(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void * } static void +my_pop_dismissed(void *data EINA_UNUSED, const Eo_Event *ev) +{ + eo_del(ev->object); +} + +static void my_pop_close_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *pop, *en; pop = data; - en = elm_object_parent_widget_get(pop); + en = eo_parent_get(pop); elm_object_text_set(en, "This is very long text," " it is longer than width of this page." " So if scroller is moved to next page," @@ -697,18 +703,19 @@ my_pop_close_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_ " and then click this entry text"); elm_entry_cursor_end_set(en); - evas_object_del(pop); + eo_event_callback_add(pop, ELM_POPUP_EVENT_DISMISSED, my_pop_dismissed, NULL); + elm_popup_dismiss(pop); } static void my_pop_bt_clr(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - Evas_Object *pop, *btn, *en; - en = data; + Evas_Object *pop, *btn, *en = data; elm_object_text_set(en, ""); elm_entry_cursor_end_set(en); - pop = elm_popup_add(en); + pop = elm_popup_add(eo_key_data_get(en, "win")); + eo_parent_set(pop, en); elm_object_text_set(pop, "If you click confirm, " "set long text to entry " "and delete popup obj"); @@ -768,6 +775,7 @@ test_entry_on_page_scroll(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, elm_object_part_content_set(ly, "element1", en); elm_entry_scrollable_set(en, EINA_TRUE); elm_entry_single_line_set(en, EINA_TRUE); + eo_key_data_set(en, "win", win); // no ref evas_object_show(en); btn = elm_button_add(ly); |