summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_popup.c
diff options
context:
space:
mode:
authorTaehyub Kim <taehyub.kim@samsung.com>2017-08-17 17:37:54 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-28 17:15:42 +0900
commit0005b3105e31556bdf22d0f124c6522d5a567387 (patch)
tree815a11e468cf7fd0659882a97308d686e5ebadd8 /src/bin/elementary/test_popup.c
parentbccd97bd62a0a2a9d95ba7d87949d92302ef50d2 (diff)
efl_ui_popup: add align and position properties
Summary: add align feature and position properties (center, left, right, top, bottom) efl_ui_popup_position_set should be seperated from evas_object_move since evas_object_move can be called internally. Test Plan: 1. run elementary_test -to efluipopup Reviewers: Jaehyun_Cho, jpeg, cedric, thiepha, Blackmole, woohyun Reviewed By: Jaehyun_Cho Differential Revision: https://phab.enlightenment.org/D5105
Diffstat (limited to '')
-rw-r--r--src/bin/elementary/test_popup.c93
1 files changed, 91 insertions, 2 deletions
diff --git a/src/bin/elementary/test_popup.c b/src/bin/elementary/test_popup.c
index cc9de42f82..e42b7dc4a9 100644
--- a/src/bin/elementary/test_popup.c
+++ b/src/bin/elementary/test_popup.c
@@ -967,6 +967,48 @@ _image_change_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
967 k = !k; 967 k = !k;
968} 968}
969 969
970static void
971_center_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
972 void *event_info EINA_UNUSED)
973{
974 efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_CENTER);
975}
976
977static void
978_left_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
979 void *event_info EINA_UNUSED)
980{
981 efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_LEFT);
982}
983
984static void
985_right_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
986 void *event_info EINA_UNUSED)
987{
988 efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_RIGHT);
989}
990
991static void
992_top_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
993 void *event_info EINA_UNUSED)
994{
995 efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_TOP);
996}
997
998static void
999_bottom_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
1000 void *event_info EINA_UNUSED)
1001{
1002 efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_BOTTOM);
1003}
1004
1005static void
1006_position_set_cb(void *data, Evas_Object *obj EINA_UNUSED,
1007 void *event_info EINA_UNUSED)
1008{
1009 efl_ui_popup_position_set(data, 0, 0);
1010}
1011
970void 1012void
971test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 1013test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
972{ 1014{
@@ -975,7 +1017,7 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
975 win = elm_win_util_standard_add("Efl UI Popup", "Efl UI Popup"); 1017 win = elm_win_util_standard_add("Efl UI Popup", "Efl UI Popup");
976 elm_win_autodel_set(win, EINA_TRUE); 1018 elm_win_autodel_set(win, EINA_TRUE);
977 1019
978 evas_object_resize(win, 320, 320); 1020 evas_object_resize(win, 500, 500);
979 evas_object_show(win); 1021 evas_object_show(win);
980 1022
981 btn = elm_button_add(win); 1023 btn = elm_button_add(win);
@@ -988,7 +1030,6 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
988 1030
989 evas_object_smart_callback_add(efl_ui_popup, "bg,clicked", _bg_clicked, NULL); 1031 evas_object_smart_callback_add(efl_ui_popup, "bg,clicked", _bg_clicked, NULL);
990 1032
991 evas_object_move(efl_ui_popup, 80, 80);
992 evas_object_resize(efl_ui_popup, 160, 160); 1033 evas_object_resize(efl_ui_popup, 160, 160);
993 evas_object_show(efl_ui_popup); 1034 evas_object_show(efl_ui_popup);
994 1035
@@ -1001,5 +1042,53 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
1001 evas_object_smart_callback_add(btn, "clicked", _image_change_btn_cb, efl_ui_popup); 1042 evas_object_smart_callback_add(btn, "clicked", _image_change_btn_cb, efl_ui_popup);
1002 evas_object_show(btn); 1043 evas_object_show(btn);
1003 1044
1045 Evas_Object *center_btn;
1046 center_btn = elm_button_add(win);
1047 elm_object_text_set(center_btn, "Center Align");
1048 evas_object_move(center_btn, 0, 300);
1049 evas_object_resize(center_btn, 100, 50);
1050 evas_object_show(center_btn);
1051 evas_object_smart_callback_add(center_btn, "clicked", _center_align_cb, efl_ui_popup);
1052
1053 Evas_Object *left_btn;
1054 left_btn = elm_button_add(win);
1055 elm_object_text_set(left_btn, "Left Align");
1056 evas_object_move(left_btn, 100, 300);
1057 evas_object_resize(left_btn, 100, 50);
1058 evas_object_show(left_btn);
1059 evas_object_smart_callback_add(left_btn, "clicked", _left_align_cb, efl_ui_popup);
1060
1061 Evas_Object *right_btn;
1062 right_btn = elm_button_add(win);
1063 elm_object_text_set(right_btn, "Right Align");
1064 evas_object_move(right_btn, 200, 300);
1065 evas_object_resize(right_btn, 100, 50);
1066 evas_object_show(right_btn);
1067 evas_object_smart_callback_add(right_btn, "clicked", _right_align_cb, efl_ui_popup);
1068
1069 Evas_Object *top_btn;
1070 top_btn = elm_button_add(win);
1071 elm_object_text_set(top_btn, "Top Align");
1072 evas_object_move(top_btn, 0, 350);
1073 evas_object_resize(top_btn, 100, 50);
1074 evas_object_show(top_btn);
1075 evas_object_smart_callback_add(top_btn, "clicked", _top_align_cb, efl_ui_popup);
1076
1077 Evas_Object *bottom_btn;
1078 bottom_btn = elm_button_add(win);
1079 elm_object_text_set(bottom_btn, "Bottom Align");
1080 evas_object_move(bottom_btn, 100, 350);
1081 evas_object_resize(bottom_btn, 100, 50);
1082 evas_object_show(bottom_btn);
1083 evas_object_smart_callback_add(bottom_btn, "clicked", _bottom_align_cb, efl_ui_popup);
1084
1085 Evas_Object *position_btn;
1086 position_btn = elm_button_add(win);
1087 elm_object_text_set(position_btn, "Position Set");
1088 evas_object_move(position_btn, 200, 350);
1089 evas_object_resize(position_btn, 100, 50);
1090 evas_object_show(position_btn);
1091 evas_object_smart_callback_add(position_btn, "clicked", _position_set_cb, efl_ui_popup);
1092
1004 efl_content_set(efl_ui_popup, btn); 1093 efl_content_set(efl_ui_popup, btn);
1005} 1094}