From 9dd44ce8526c584a054851ae8bf76898533b1c3c Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Tue, 12 Feb 2013 06:58:05 +0000 Subject: [PATCH] elementary/ctxpopup - ctxpopup will be dismissed when the language is changed. SVN revision: 83841 --- legacy/elementary/ChangeLog | 4 ++++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elc_ctxpopup.c | 12 ++++++++++++ legacy/elementary/src/lib/elc_ctxpopup.h | 5 +++-- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index f1ea8489fe..a048e04880 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/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/legacy/elementary/NEWS b/legacy/elementary/NEWS index 6efa0fa49f..d72156531f 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/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/legacy/elementary/src/lib/elc_ctxpopup.c b/legacy/elementary/src/lib/elc_ctxpopup.c index e3144819f9..a6183ba232 100644 --- a/legacy/elementary/src/lib/elc_ctxpopup.c +++ b/legacy/elementary/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/legacy/elementary/src/lib/elc_ctxpopup.h b/legacy/elementary/src/lib/elc_ctxpopup.h index 208431092f..afebbb475e 100644 --- a/legacy/elementary/src/lib/elc_ctxpopup.h +++ b/legacy/elementary/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