diff options
author | Bora Hwang <bora1.hwang@samsung.com> | 2014-02-09 18:11:47 +0900 |
---|---|---|
committer | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-02-09 18:11:47 +0900 |
commit | f086ac9a971198d9991edee43d3c5db50a0db9da (patch) | |
tree | 6eff8c178138cc98d16c6e866b061fdb30d18009 /src/bin/test_ctxpopup.c | |
parent | 625e63399da158d64ccf51a7e73a1ecb1dfd14f7 (diff) | |
download | elementary-f086ac9a971198d9991edee43d3c5db50a0db9da.tar.gz |
ctxpopup: add a new api for ctxpopup which makes ctxpopup not to hide automatically
Summary:
Developer can use this API for the case when he/she wants ctxpopup not to hide
automatically when parent of ctxpopup is resized or language is changed.
Default value of "disabled" is EINA_FALSE. So if user sets "disabled" EINA_TRUE
and parent size changes, ctxpopup recalculates its size and position.
Since size of bg is set when setting parent only, it should be resized again.
Reviewers: Hermet, seoz, thiepha, raster
CC: c
Differential Revision: https://phab.enlightenment.org/D510
Diffstat (limited to 'src/bin/test_ctxpopup.c')
-rw-r--r-- | src/bin/test_ctxpopup.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/test_ctxpopup.c b/src/bin/test_ctxpopup.c index 99f961eb7..4f807f6a7 100644 --- a/src/bin/test_ctxpopup.c +++ b/src/bin/test_ctxpopup.c @@ -35,6 +35,7 @@ _print_current_dir(Evas_Object *obj) printf("ctxpopup direction: unknow!\n"); break; } + printf(" [%s : %d] auto_hide_mode=%d\n", __func__, __LINE__, elm_ctxpopup_auto_hide_disabled_get(obj)); } static void @@ -324,6 +325,32 @@ _list_item_cb7(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_U } static void +_list_item_cb8(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Evas_Object *ctxpopup; + Elm_Object_Item *it = NULL; + Evas_Coord x,y; + + if (list_mouse_down > 0) return; + + ctxpopup = elm_ctxpopup_add(obj); + evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL); + elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE); + + _ctxpopup_item_new(ctxpopup, "Go to home folder", "home"); + _ctxpopup_item_new(ctxpopup, "Save file", "file"); + _ctxpopup_item_new(ctxpopup, "Delete file", "delete"); + it = _ctxpopup_item_new(ctxpopup, "Navigate to folder", "folder"); + elm_object_item_disabled_set(it, EINA_TRUE); + _ctxpopup_item_new(ctxpopup, "Edit entry", "edit"); + + evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); + _print_current_dir(ctxpopup); +} + +static void _list_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) { elm_list_item_selected_set(event_info, EINA_FALSE); @@ -380,6 +407,8 @@ test_ctxpopup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ _list_item_cb6, NULL); elm_list_item_append(list, "Ctxpopup with callback function", NULL, NULL, _list_item_cb7, NULL); + elm_list_item_append(list, "Ctxpopup with auto hide disabled mode", NULL, NULL, + _list_item_cb8, NULL); evas_object_show(list); elm_list_go(list); |