From 5e77b4de7d23b6b1beda090d3f158c5e6014e40f Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Sat, 23 Jul 2011 12:05:03 +0900 Subject: [PATCH] [ctxpoup] support dynamic theme changing Change-Id: I8a0873610180992c0133a1f6c834febe305a2542 --- src/lib/elc_ctxpopup.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c index a14c7d6..2fdffef 100644 --- a/src/lib/elc_ctxpopup.c +++ b/src/lib/elc_ctxpopup.c @@ -692,6 +692,7 @@ _theme_hook(Evas_Object *obj) Widget_Data *wd; Eina_List *elist; Elm_Ctxpopup_Item *item; + int idx = 0; wd = elm_widget_data_get(obj); if (!wd) return; @@ -715,11 +716,30 @@ _theme_hook(Evas_Object *obj) if (item->disabled) edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm"); + /* + * For separator, if the first item has visible separator, + * then it should be aligned with edge of the base part. + * In some cases, it gives improper display. Ex) rounded corner + * So the first item separator should be invisible. + */ + if ((idx++) == 0) + edje_object_signal_emit(item->base.view, "elm,state,default", "elm"); + else + { + if(!wd->horizontal) + edje_object_signal_emit(item->base.view, "elm,state,vertical", "elm"); + else + edje_object_signal_emit(item->base.view, "elm,state,horizontal", "elm"); + } + edje_object_message_signal_process(item->base.view); } _elm_theme_object_set(obj, wd->bg, "ctxpopup", "bg", elm_widget_style_get(obj)); + if (evas_object_visible_get(wd->bg)) + edje_object_signal_emit(wd->bg, "elm,state,show", "elm"); + _elm_theme_object_set(obj, wd->base, "ctxpopup", "base", elm_widget_style_get(obj)); _elm_theme_object_set(obj, wd->arrow, "ctxpopup", "arrow", @@ -799,7 +819,7 @@ _ctxpopup_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, else edje_object_signal_emit(item->base.view, "elm,state,horizontal", "elm"); } - } + } _sizing_eval(obj); } -- 2.7.4