aboutsummaryrefslogtreecommitdiffstats
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
parentefl_ui_popup: add bg_set and bg_repeat_events_set/get API (diff)
downloadefl-0005b3105e31556bdf22d0f124c6522d5a567387.tar.gz
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 'src/bin/elementary/test_popup.c')
-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,
k = !k;
}
+static void
+_center_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_CENTER);
+}
+
+static void
+_left_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_LEFT);
+}
+
+static void
+_right_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_RIGHT);
+}
+
+static void
+_top_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_TOP);
+}
+
+static void
+_bottom_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efl_ui_popup_align_set(data, EFL_UI_POPUP_ALIGN_BOTTOM);
+}
+
+static void
+_position_set_cb(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ efl_ui_popup_position_set(data, 0, 0);
+}
+
void
test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@@ -975,7 +1017,7 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
win = elm_win_util_standard_add("Efl UI Popup", "Efl UI Popup");
elm_win_autodel_set(win, EINA_TRUE);
- evas_object_resize(win, 320, 320);
+ evas_object_resize(win, 500, 500);
evas_object_show(win);
btn = elm_button_add(win);
@@ -988,7 +1030,6 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
evas_object_smart_callback_add(efl_ui_popup, "bg,clicked", _bg_clicked, NULL);
- evas_object_move(efl_ui_popup, 80, 80);
evas_object_resize(efl_ui_popup, 160, 160);
evas_object_show(efl_ui_popup);
@@ -1001,5 +1042,53 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
evas_object_smart_callback_add(btn, "clicked", _image_change_btn_cb, efl_ui_popup);
evas_object_show(btn);
+ Evas_Object *center_btn;
+ center_btn = elm_button_add(win);
+ elm_object_text_set(center_btn, "Center Align");
+ evas_object_move(center_btn, 0, 300);
+ evas_object_resize(center_btn, 100, 50);
+ evas_object_show(center_btn);
+ evas_object_smart_callback_add(center_btn, "clicked", _center_align_cb, efl_ui_popup);
+
+ Evas_Object *left_btn;
+ left_btn = elm_button_add(win);
+ elm_object_text_set(left_btn, "Left Align");
+ evas_object_move(left_btn, 100, 300);
+ evas_object_resize(left_btn, 100, 50);
+ evas_object_show(left_btn);
+ evas_object_smart_callback_add(left_btn, "clicked", _left_align_cb, efl_ui_popup);
+
+ Evas_Object *right_btn;
+ right_btn = elm_button_add(win);
+ elm_object_text_set(right_btn, "Right Align");
+ evas_object_move(right_btn, 200, 300);
+ evas_object_resize(right_btn, 100, 50);
+ evas_object_show(right_btn);
+ evas_object_smart_callback_add(right_btn, "clicked", _right_align_cb, efl_ui_popup);
+
+ Evas_Object *top_btn;
+ top_btn = elm_button_add(win);
+ elm_object_text_set(top_btn, "Top Align");
+ evas_object_move(top_btn, 0, 350);
+ evas_object_resize(top_btn, 100, 50);
+ evas_object_show(top_btn);
+ evas_object_smart_callback_add(top_btn, "clicked", _top_align_cb, efl_ui_popup);
+
+ Evas_Object *bottom_btn;
+ bottom_btn = elm_button_add(win);
+ elm_object_text_set(bottom_btn, "Bottom Align");
+ evas_object_move(bottom_btn, 100, 350);
+ evas_object_resize(bottom_btn, 100, 50);
+ evas_object_show(bottom_btn);
+ evas_object_smart_callback_add(bottom_btn, "clicked", _bottom_align_cb, efl_ui_popup);
+
+ Evas_Object *position_btn;
+ position_btn = elm_button_add(win);
+ elm_object_text_set(position_btn, "Position Set");
+ evas_object_move(position_btn, 200, 350);
+ evas_object_resize(position_btn, 100, 50);
+ evas_object_show(position_btn);
+ evas_object_smart_callback_add(position_btn, "clicked", _position_set_cb, efl_ui_popup);
+
efl_content_set(efl_ui_popup, btn);
}