From: ChunEon Park Date: Tue, 12 Feb 2013 06:58:05 +0000 (+0000) Subject: elementary/ctxpopup - ctxpopup will be dismissed when the language is changed. X-Git-Tag: submit/efl/20131021.015827~1004 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=431e37ac4cd83b56f54f00ed78168432249b1e7b;p=platform%2Fupstream%2Felementary.git elementary/ctxpopup - ctxpopup will be dismissed when the language is changed. SVN revision: 83841 --- diff --git a/ChangeLog b/ChangeLog index f1ea848..a048e04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -989,3 +989,7 @@ * GLview supports "language,changed" smart callback. +2013-02-13 ChunEon Park (Hermet) + + * Ctxpopup will be dismissed when elm language is changed. + diff --git a/NEWS b/NEWS index 6efa0fa..d721565 100644 --- a/NEWS +++ b/NEWS @@ -62,6 +62,7 @@ Improvements: * Enhanced diskselector add and item_append time. * Expand elm_transit_tween_mode ELM_TRANSIT_TWEEN_MODE_DIVISOR_INTERP, ELM_TRANSIT_TWEEN_MODE_BOUNCE, ELM_TRANSIT_TWEEN_MODE_SPRING * Added new APIs elm_transit_tween_mode_facator_set()/get() + * Ctxpopup will be dismissed when language is changed. Fixes: diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c index e314481..a6183ba 100644 --- a/src/lib/elc_ctxpopup.c +++ b/src/lib/elc_ctxpopup.c @@ -11,11 +11,22 @@ EAPI Eo_Op ELM_OBJ_CTXPOPUP_BASE_ID = EO_NOOP; EAPI const char ELM_CTXPOPUP_SMART_NAME[] = "elm_ctxpopup"; static const char SIG_DISMISSED[] = "dismissed"; +static const char SIG_LANG_CHANGED[] = "language,changed"; + static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_DISMISSED, ""}, + {SIG_LANG_CHANGED, ""}, {NULL, NULL} }; +static void +_elm_ctxpopup_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list) +{ + Eina_Bool *ret = va_arg(*list, Eina_Bool *); + evas_object_hide(obj); + + if (ret) *ret = EINA_TRUE; +} static void _elm_ctxpopup_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) @@ -1426,6 +1437,7 @@ _class_constructor(Eo_Class *klass) EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_ctxpopup_smart_focus_next_manager_is), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_ctxpopup_smart_focus_next), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_ctxpopup_smart_focus_direction_manager_is), + EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_ctxpopup_smart_translate), EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_ctxpopup_smart_content_set), EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_ctxpopup_smart_content_get), diff --git a/src/lib/elc_ctxpopup.h b/src/lib/elc_ctxpopup.h index 2084310..afebbb4 100644 --- a/src/lib/elc_ctxpopup.h +++ b/src/lib/elc_ctxpopup.h @@ -24,8 +24,9 @@ * * This widget emits the following signals, besides the ones sent from * @ref Layout: - * - @c "dismissed" - this is called when the outside of ctxpopup was clicked - * and ctxpopup is dismissed. + * - @c "dismissed" - this is called when the outside of ctxpopup was clicked or + * it's parent area is changed or the language is changed. and then ctxpopup is + * dismissed. * * Default content parts of the ctxpopup widget that you can use for are: * @li "default" - A content of the ctxpopup