summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-04-09 11:41:05 +0100
committerAlastair Poole <netstar@gmail.com>2020-04-09 11:41:05 +0100
commiteaa2ad523ee0299d4365faaaf2b0b10a9465d3f6 (patch)
treef994f811f0a830410f887ac702ad676138b2e815
parent351e9fa23f1389f33fc8cf12ab6ed18ee2f0b72b (diff)
tests: Add case to match ephoto behaviour.
-rw-r--r--src/bin/elementary/test_popup.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/bin/elementary/test_popup.c b/src/bin/elementary/test_popup.c
index da9bbca934..33dbeada1d 100644
--- a/src/bin/elementary/test_popup.c
+++ b/src/bin/elementary/test_popup.c
@@ -845,6 +845,80 @@ _popup_scroll_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA
845 is_popup_scroll = elm_check_state_get(obj); 845 is_popup_scroll = elm_check_state_get(obj);
846} 846}
847 847
848static void
849_popup_scrollable_scroller_content_list_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
850{
851 Evas_Object *win, *popup, *box, *btn, *scroller, *table, *list, *ic;
852 Evas_Object *box2, *label;
853 Elm_Object_Item *ex1, *ex2;
854
855 win = data;
856
857 popup = elm_popup_add(win);
858 elm_popup_scrollable_set(popup, EINA_TRUE);
859 elm_object_part_text_set(popup, "title,text", "Title");
860 elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
861 evas_object_show(popup);
862
863 box = elm_box_add(popup);
864 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
865 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
866 evas_object_size_hint_min_set(box, 200 * elm_config_scale_get(), 200 * elm_config_scale_get());
867 evas_object_show(box);
868
869 scroller = elm_scroller_add(box);
870 evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
871 evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
872 elm_box_pack_end(box, scroller);
873 evas_object_show(scroller);
874
875 table = elm_table_add(scroller);
876 elm_table_homogeneous_set(table, EINA_FALSE);
877 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
878 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
879 evas_object_show(table);
880
881 list = elm_list_add(table);
882 elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
883 elm_scroller_content_min_limit(list, 1, 1);
884 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
885 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
886 elm_table_pack(table, list, 0, 0, 1, 1);
887 evas_object_show(list);
888
889 box2 = elm_box_add(table);
890 evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
891 evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
892 elm_table_pack(table, box2, 1, 0, 2, 1);
893 evas_object_show(box2);
894
895 label = elm_label_add(popup);
896 elm_object_text_set(label, "Wash the soap<br>rub it on your<br>hands.");
897 evas_object_show(label);
898 elm_box_pack_end(box2, label);
899
900 ic = elm_icon_add(list);
901 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
902 elm_icon_standard_set(ic, "input-keyboard");
903 evas_object_show(ic);
904
905 ex1 = elm_list_item_append(list, "Jambalaya", ic, NULL, NULL, NULL);
906 ex2 = elm_list_item_append(list, "Mississippi", ic, NULL, NULL, NULL);
907
908 elm_list_go(list);
909 elm_list_item_selected_set(ex1, EINA_TRUE);
910
911 btn = elm_button_add(popup);
912 elm_object_text_set(btn, "Close");
913 evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
914 elm_object_part_content_set(popup, "button1", btn);
915
916 elm_object_content_set(scroller, table);
917 elm_object_content_set(popup, box);
918
919 evas_object_show(popup);
920}
921
848void 922void
849test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 923test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
850 void *event_info EINA_UNUSED) 924 void *event_info EINA_UNUSED)
@@ -911,6 +985,8 @@ test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
911 win); 985 win);
912 elm_list_item_append(list, "popup-center-title + text + 1 button + hide effect", NULL, 986 elm_list_item_append(list, "popup-center-title + text + 1 button + hide effect", NULL,
913 NULL, _popup_center_title_text_1button_hide_effect_cb, win); 987 NULL, _popup_center_title_text_1button_hide_effect_cb, win);
988 elm_list_item_append(list, "popup-scrollable-with-scroller-as-content-and-list",
989 NULL, NULL, _popup_scrollable_scroller_content_list_cb, win);
914 elm_list_go(list); 990 elm_list_go(list);
915 evas_object_show(list); 991 evas_object_show(list);
916 992