summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_ui_popup.c
diff options
context:
space:
mode:
authorJinYong Park <j4939.park@samsung.com>2017-12-15 13:56:25 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-12-15 13:56:25 +0900
commitccfa9ae2201a6b567859f8d16d2674c3be7b81f6 (patch)
tree707725c8286175f052ed752012aca444bda09123 /src/bin/elementary/test_ui_popup.c
parentfe8c5f8269b06165a7c7b1da9a956ef0839bad52 (diff)
Efl.Ui.Popup.Anchor: apply group calculate with size problem fix
Summary: Size and align calculation in Efl.Ui.Popup was advanced using group calculate, so Efl.Ui.Popup.Anchor apply it also. Test Plan: elementary_test -to efl.ui.popup.anchor Reviewers: Jaehyun_Cho, herb, jpeg, woohyun, cedric Reviewed By: Jaehyun_Cho Differential Revision: https://phab.enlightenment.org/D5655
Diffstat (limited to '')
-rw-r--r--src/bin/elementary/test_ui_popup.c56
1 files changed, 39 insertions, 17 deletions
diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c
index 04bd30828c..5f57e79179 100644
--- a/src/bin/elementary/test_ui_popup.c
+++ b/src/bin/elementary/test_ui_popup.c
@@ -185,6 +185,22 @@ _position_set_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
185} 185}
186 186
187static void 187static void
188_popup_resize_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
189{
190 efl_ui_popup_data *p_data = data;
191 if (!p_data->efl_ui_popup) return;
192
193 static Eina_Bool size_changed = EINA_FALSE;
194
195 if (!size_changed)
196 efl_ui_popup_size_set(p_data->efl_ui_popup, EINA_SIZE2D(300, 160));
197 else
198 efl_ui_popup_size_set(p_data->efl_ui_popup, EINA_SIZE2D(160, 120));
199
200 size_changed = !size_changed;
201}
202
203static void
188_timeout_set_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) 204_timeout_set_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
189{ 205{
190 efl_ui_popup_data *p_data = data; 206 efl_ui_popup_data *p_data = data;
@@ -1038,37 +1054,43 @@ test_ui_popup_anchor(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
1038 efl_text_set(btn, "Center Align"); 1054 efl_text_set(btn, "Center Align");
1039 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); 1055 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
1040 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data); 1056 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data);
1041 efl_pack_grid(grid, btn, 0, 0, 1, 1); 1057 efl_pack_grid(grid, btn, 0, 0, 2, 1);
1042
1043 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1044 efl_text_set(btn, "Left Align");
1045 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
1046 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data);
1047 efl_pack_grid(grid, btn, 1, 0, 1, 1);
1048
1049 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1050 efl_text_set(btn, "Right Align");
1051 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
1052 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data);
1053 efl_pack_grid(grid, btn, 2, 0, 1, 1);
1054 1058
1055 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); 1059 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1056 efl_text_set(btn, "Top Align"); 1060 efl_text_set(btn, "Top Align");
1057 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); 1061 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
1058 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data); 1062 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data);
1059 efl_pack_grid(grid, btn, 0, 1, 1, 1); 1063 efl_pack_grid(grid, btn, 2, 0, 2, 1);
1060 1064
1061 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); 1065 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1062 efl_text_set(btn, "Bottom Align"); 1066 efl_text_set(btn, "Bottom Align");
1063 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); 1067 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
1064 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data); 1068 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data);
1065 efl_pack_grid(grid, btn, 1, 1, 1, 1); 1069 efl_pack_grid(grid, btn, 4, 0, 2, 1);
1070
1071 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1072 efl_text_set(btn, "Left Align");
1073 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
1074 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data);
1075 efl_pack_grid(grid, btn, 0, 1, 3, 1);
1076
1077 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1078 efl_text_set(btn, "Right Align");
1079 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
1080 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data);
1081 efl_pack_grid(grid, btn, 3, 1, 3, 1);
1066 1082
1067 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); 1083 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1068 efl_text_set(btn, "Position Set"); 1084 efl_text_set(btn, "Position Set");
1069 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35)); 1085 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
1070 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data); 1086 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data);
1071 efl_pack_grid(grid, btn, 2, 1, 1, 1); 1087 efl_pack_grid(grid, btn, 0, 2, 3, 1);
1088
1089 btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
1090 efl_text_set(btn, "Resize");
1091 efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
1092 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _popup_resize_cb, p_data);
1093 efl_pack_grid(grid, btn, 3, 2, 3, 1);
1072 1094
1073 efl_content_set(efl_ui_popup, grid); 1095 efl_content_set(efl_ui_popup, grid);
1074} 1096}