summaryrefslogtreecommitdiff
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorJinYong Park <j4939.park@samsung.com>2017-08-10 15:48:36 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-28 17:15:42 +0900
commitbccd97bd62a0a2a9d95ba7d87949d92302ef50d2 (patch)
tree8ffdba09e470bae3866d42706690a20645b860d3 /src/bin/elementary
parent996a975506edbbc695ecf6ec5e6c4c58a1ac1a50 (diff)
efl_ui_popup: add bg_set and bg_repeat_events_set/get API
Summary: add bg_set and bg_repeat_events_set/get API bg_set enables user change popup's outside bg bg_repeat_events_set enables popup's outside bg repeat events Test Plan: 1. run elementary_test -to efluipopup 2. click outside area of popup 3. click button in popup Reviewers: Jaehyun_Cho, herb, thiepha, woohyun, cedric, jpeg, singh.amitesh Reviewed By: Jaehyun_Cho Subscribers: jpeg Tags: #efl Differential Revision: https://phab.enlightenment.org/D5054
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test_popup.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/bin/elementary/test_popup.c b/src/bin/elementary/test_popup.c
index dbbb1a8891..cc9de42f82 100644
--- a/src/bin/elementary/test_popup.c
+++ b/src/bin/elementary/test_popup.c
@@ -939,10 +939,38 @@ test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
939 evas_object_show(win); 939 evas_object_show(win);
940} 940}
941 941
942static void
943_bg_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
944 void *event_info EINA_UNUSED)
945{
946 printf("Popup's background is clicked.\n");
947}
948
949static void
950_image_change_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
951 void *event_info EINA_UNUSED)
952{
953 static int k = 0;
954
955 if (k == 0)
956 {
957 char buf[PATH_MAX];
958 snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
959 efl_ui_popup_bg_set(data, buf, NULL);
960 efl_ui_popup_bg_repeat_events_set(data, EINA_TRUE);
961 }
962 else
963 {
964 efl_ui_popup_bg_set(data, NULL, NULL);
965 efl_ui_popup_bg_repeat_events_set(data, EINA_FALSE);
966 }
967 k = !k;
968}
969
942void 970void
943test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 971test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
944{ 972{
945 Evas_Object *win; 973 Evas_Object *win, *btn;
946 974
947 win = elm_win_util_standard_add("Efl UI Popup", "Efl UI Popup"); 975 win = elm_win_util_standard_add("Efl UI Popup", "Efl UI Popup");
948 elm_win_autodel_set(win, EINA_TRUE); 976 elm_win_autodel_set(win, EINA_TRUE);
@@ -950,8 +978,16 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
950 evas_object_resize(win, 320, 320); 978 evas_object_resize(win, 320, 320);
951 evas_object_show(win); 979 evas_object_show(win);
952 980
981 btn = elm_button_add(win);
982 elm_object_text_set(btn, "bg repeat events test");
983 evas_object_move(btn, 0, 0);
984 evas_object_resize(btn, 150, 150);
985 evas_object_show(btn);
986
953 Evas_Object *efl_ui_popup= efl_add(EFL_UI_POPUP_CLASS, win); 987 Evas_Object *efl_ui_popup= efl_add(EFL_UI_POPUP_CLASS, win);
954 988
989 evas_object_smart_callback_add(efl_ui_popup, "bg,clicked", _bg_clicked, NULL);
990
955 evas_object_move(efl_ui_popup, 80, 80); 991 evas_object_move(efl_ui_popup, 80, 80);
956 evas_object_resize(efl_ui_popup, 160, 160); 992 evas_object_resize(efl_ui_popup, 160, 160);
957 evas_object_show(efl_ui_popup); 993 evas_object_show(efl_ui_popup);
@@ -960,8 +996,9 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
960 evas_object_geometry_get(efl_ui_popup, &x, &y, &w, &h); 996 evas_object_geometry_get(efl_ui_popup, &x, &y, &w, &h);
961 printf("efl_ui_popup: %d %d %d %d\n", x, y, w, h); 997 printf("efl_ui_popup: %d %d %d %d\n", x, y, w, h);
962 998
963 Evas_Object *btn = elm_button_add(efl_ui_popup); 999 btn = elm_button_add(efl_ui_popup);
964 elm_object_text_set(btn, "Efl.Ui.Popup content"); 1000 elm_object_text_set(btn, "Efl.Ui.Popup content");
1001 evas_object_smart_callback_add(btn, "clicked", _image_change_btn_cb, efl_ui_popup);
965 evas_object_show(btn); 1002 evas_object_show(btn);
966 1003
967 efl_content_set(efl_ui_popup, btn); 1004 efl_content_set(efl_ui_popup, btn);