diff --git a/legacy/elementary/src/bin/test_ctxpopup.c b/legacy/elementary/src/bin/test_ctxpopup.c index 01189b5093..20ae0193cb 100644 --- a/legacy/elementary/src/bin/test_ctxpopup.c +++ b/legacy/elementary/src/bin/test_ctxpopup.c @@ -37,8 +37,44 @@ _print_current_dir(Evas_Object *obj) } } +static Eina_Bool +_ctxpopup_raise_timer_cb(void *data) +{ + printf("Timer Called\n"); + Evas_Object *ctxpopup = (Evas_Object *) data; + evas_object_raise(ctxpopup); + return EINA_FALSE; +} + static void -_ctxpopup_item_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_btn_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + printf("Button Clicked\n"); + Evas_Object *ctxpopup = (Evas_Object *) data; + Evas_Object *lb = elm_label_add(ctxpopup); + elm_label_line_wrap_set(lb, ELM_WRAP_CHAR); + elm_object_text_set(lb, + "" + "This is more text designed to line-wrap here as " + "This object is resized horizontally. As it is " + "resized vertically though, nothing should change. " + "The amount of space allocated vertically should " + "change as horizontal size changes." + "This is more text designed to line-wrap here as " + "This object is resized horizontally. As it is " + "resized vertically though, nothing should change. " + "The amount of space allocated vertically should " + "change as horizontal size changes." + "" + ); + evas_object_resize(lb, 200, 400); + evas_object_show(lb); + + ecore_timer_add(1.5, _ctxpopup_raise_timer_cb, ctxpopup); +} + +static void +_ctxpopup_item_cb(void *data , Evas_Object *obj __UNUSED__, void *event_info) { printf("ctxpopup item selected: %s\n", elm_object_item_text_get(event_info)); @@ -204,6 +240,8 @@ _list_item_cb5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_move(ctxpopup, x, y); evas_object_show(ctxpopup); _print_current_dir(ctxpopup); + + evas_object_smart_callback_add(btn, "clicked", _btn_clicked, ctxpopup); } diff --git a/legacy/elementary/src/lib/elc_ctxpopup.c b/legacy/elementary/src/lib/elc_ctxpopup.c index a24c155b35..b6e4a81844 100644 --- a/legacy/elementary/src/lib/elc_ctxpopup.c +++ b/legacy/elementary/src/lib/elc_ctxpopup.c @@ -119,6 +119,7 @@ static void _ctxpopup_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _restack(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _item_select_cb(void *data, Evas_Object *obj, const char *emission, const char *source); @@ -1102,6 +1103,17 @@ _ctxpopup_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, _sizing_eval(obj); } +static void +_restack(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + evas_object_layer_set(wd->bg, + evas_object_layer_get(obj)); + evas_object_layer_set(wd->base, + evas_object_layer_get(obj)); +} + static void _item_select_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) @@ -1272,6 +1284,7 @@ elm_ctxpopup_add(Evas_Object *parent) NULL); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _ctxpopup_move, NULL); + evas_object_event_callback_add(obj, EVAS_CALLBACK_RESTACK, _restack, obj); evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj); evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj); evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);