summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-07-04 17:22:11 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-04 18:10:38 +0900
commitb8fd5e875ab67cd76467d2fdb52130aff14d4dfd (patch)
treeee6db896a2ff485546dc49ee3fed8eadf4e1fc51
parent8fb3fc166f2e518ec5ed4a0405eb4ded18227255 (diff)
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.c18
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 *
685} 685}
686 686
687static void 687static void
688my_pop_dismissed(void *data EINA_UNUSED, const Eo_Event *ev)
689{
690 eo_del(ev->object);
691}
692
693static void
688my_pop_close_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 694my_pop_close_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
689{ 695{
690 Evas_Object *pop, *en; 696 Evas_Object *pop, *en;
691 pop = data; 697 pop = data;
692 en = elm_object_parent_widget_get(pop); 698 en = eo_parent_get(pop);
693 elm_object_text_set(en, "This is very long text," 699 elm_object_text_set(en, "This is very long text,"
694 " it is longer than width of this page." 700 " it is longer than width of this page."
695 " So if scroller is moved to next page," 701 " 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_
697 " and then click this entry text"); 703 " and then click this entry text");
698 elm_entry_cursor_end_set(en); 704 elm_entry_cursor_end_set(en);
699 705
700 evas_object_del(pop); 706 eo_event_callback_add(pop, ELM_POPUP_EVENT_DISMISSED, my_pop_dismissed, NULL);
707 elm_popup_dismiss(pop);
701} 708}
702 709
703static void 710static void
704my_pop_bt_clr(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 711my_pop_bt_clr(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
705{ 712{
706 Evas_Object *pop, *btn, *en; 713 Evas_Object *pop, *btn, *en = data;
707 en = data;
708 elm_object_text_set(en, ""); 714 elm_object_text_set(en, "");
709 elm_entry_cursor_end_set(en); 715 elm_entry_cursor_end_set(en);
710 716
711 pop = elm_popup_add(en); 717 pop = elm_popup_add(eo_key_data_get(en, "win"));
718 eo_parent_set(pop, en);
712 elm_object_text_set(pop, "If you click confirm, " 719 elm_object_text_set(pop, "If you click confirm, "
713 "set long text to entry " 720 "set long text to entry "
714 "and delete popup obj"); 721 "and delete popup obj");
@@ -768,6 +775,7 @@ test_entry_on_page_scroll(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
768 elm_object_part_content_set(ly, "element1", en); 775 elm_object_part_content_set(ly, "element1", en);
769 elm_entry_scrollable_set(en, EINA_TRUE); 776 elm_entry_scrollable_set(en, EINA_TRUE);
770 elm_entry_single_line_set(en, EINA_TRUE); 777 elm_entry_single_line_set(en, EINA_TRUE);
778 eo_key_data_set(en, "win", win); // no ref
771 evas_object_show(en); 779 evas_object_show(en);
772 780
773 btn = elm_button_add(ly); 781 btn = elm_button_add(ly);