From a4eb5404f9147c0681c27c087a9dcd4ee027b8c6 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Tue, 30 Nov 2010 14:28:26 +0900 Subject: [PATCH] [changlog] repackaging [elm_ctxpopup.c] fixed ctxpopup sizing problem --- debian/changelog | 8 ++++++++ src/lib/Elementary.h.in | 2 -- src/lib/elm_ctxpopup.c | 30 +++++++++++++----------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3774684..911d490 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +elementary (1.0.0+svn.51480slp2+build68) unstable; urgency=low + + * fixed ctxpopup sizing problem. + * Git: 165.213.180.234:/git/slp/pkgs/elementary + * Tag: elementary_1.0.0+svn.51480slp2+build68 + + -- ChunEon Park Tue, 30 Nov 2010 14:27:50 +0900 + elementary (1.0.0+svn.51480slp2+build67) unstable; urgency=low * fixed ctxpopup problem. diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 659287a..590873d 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -2056,8 +2056,6 @@ extern "C" { EAPI void elm_ctxpopup_position_forced_set(Evas_Object *obj, Eina_Bool forced); EAPI Eina_Bool elm_ctxpopup_position_forced_get(Evas_Object *obj); EAPI void elm_ctxpopup_area_set(Evas_Object *obj, Evas_Object *rect); - EINA_DEPRECATED EAPI void elm_ctxpopup_title_set(Evas_Object *obj, const char *title); - EINA_DEPRECATED EAPI const char *elm_ctxpopup_title_get(Evas_Object *obj); /* Tab */ typedef enum _Elm_Tab_Move_Type diff --git a/src/lib/elm_ctxpopup.c b/src/lib/elm_ctxpopup.c index 5fd8bb0..188afcb 100644 --- a/src/lib/elm_ctxpopup.c +++ b/src/lib/elm_ctxpopup.c @@ -691,6 +691,8 @@ static void _sizing_eval(Evas_Object *obj) evas_object_move(wd->base, rect.x, rect.y); evas_object_resize(wd->base, rect.w, rect.h); + + if(wd->visible) _show_effect(wd); } static void _shift_base_by_arrow(Evas_Object *arrow, @@ -722,8 +724,6 @@ static void _del_pre_hook(Evas_Object *obj) { Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj); if (!wd) return; - fprintf(stderr, "del!\n"); - evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, obj); @@ -743,7 +743,6 @@ static void _del_hook(Evas_Object *obj) if (!wd) return; - fprintf(stderr, "del2\n"); elm_ctxpopup_clear(obj); evas_object_del(wd->arrow); evas_object_del(wd->base); @@ -857,7 +856,6 @@ static void _ctxpopup_show(void *data, Evas *e, Evas_Object *obj, return; wd->visible = EINA_TRUE; - _sizing_eval(obj); if (!wd->screen_dimmed_disabled) { evas_object_show(wd->bg); @@ -870,7 +868,8 @@ static void _ctxpopup_show(void *data, Evas *e, Evas_Object *obj, evas_object_show(wd->arrow); } - _show_effect(wd); + _sizing_eval(obj); + } static void _hide_ctxpopup(Evas_Object *obj) @@ -979,16 +978,14 @@ static void _item_obj_create(Elm_Ctxpopup_Item *item, char *group_name) static void _content_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { Widget_Data *wd = (Widget_Data *) elm_widget_data_get(data); - Evas_Coord x, y, w, h; + Evas_Coord w, h; if(!wd) return; - evas_object_geometry_get(obj, &x, &y, &w, &h); + evas_object_geometry_get(obj, NULL, NULL, &w, &h); evas_object_size_hint_min_set(obj, w, h); - if(wd->visible) { - _sizing_eval(data); - } + if(wd->visible) _sizing_eval(data); } static void _content_del(void *data, Evas *e, Evas_Object *obj, void *event_info) @@ -996,8 +993,6 @@ static void _content_del(void *data, Evas *e, Evas_Object *obj, void *event_info elm_ctxpopup_content_unset(data); } - - /** * Get the icon object for the given item. * @@ -1500,11 +1495,15 @@ EAPI void elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj); + Evas_Coord w, h; if(!wd || !content) return; evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _content_del, obj); -// evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _content_changed_size_hints, obj); evas_object_event_callback_add(content, EVAS_CALLBACK_RESIZE, _content_resize, obj); + + evas_object_geometry_get(content, NULL, NULL, &w, &h); + + if((w > 0) || (h > 0)) evas_object_size_hint_min_set(content, w, h); edje_object_part_swallow(wd->base, "elm.swallow.content", content); elm_widget_sub_object_add(obj, content); @@ -1537,7 +1536,7 @@ elm_ctxpopup_content_unset(Evas_Object *obj) edje_object_part_unswallow(wd->base, content); elm_widget_sub_object_del(obj, content); evas_object_event_callback_del(content, EVAS_CALLBACK_DEL, _content_del); - evas_object_event_callback_del(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _content_resize); + evas_object_event_callback_del(content, EVAS_CALLBACK_RESIZE, _content_resize); edje_object_signal_emit(wd->base, "elm,state,content,disable", "elm"); elm_ctxpopup_scroller_disabled_set(obj, EINA_FALSE); @@ -1586,7 +1585,6 @@ EAPI Eina_Bool elm_ctxpopup_position_forced_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj); - return wd->position_forced; } @@ -1629,7 +1627,6 @@ EAPI void elm_ctxpopup_area_set(Evas_Object *obj, Evas_Object *area) _area_rect_resize, obj); wd->area_rect = area; } - } EAPI void elm_ctxpopup_title_set(Evas_Object *obj, const char *title ) @@ -1642,7 +1639,6 @@ EAPI void elm_ctxpopup_title_set(Evas_Object *obj, const char *title ) if(wd->title) eina_stringshare_del(wd->title); wd->title = eina_stringshare_add(title); edje_object_part_text_set(wd->base, "elm.title", title); - } EAPI const char* elm_ctxpopup_title_get(Evas_Object *obj) -- 2.7.4