From: hermet Date: Thu, 29 Mar 2012 07:08:22 +0000 (+0000) Subject: elementary/panes - Patch to handle deletion of current contents while setting new... X-Git-Tag: 1.0.0+svn.69691slp2+build01~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18ff168f7f2429513bbd40cc1855420c231e97c8;p=framework%2Fuifw%2Felementary.git elementary/panes - Patch to handle deletion of current contents while setting new ones Change Description: 1. Unswallowing the contents now in _sub_del as this is a common function to be executed when subobject removal happens. 2. Comparing the current content with new before deleting. Signed-Off-By: RAJEEV RANJAN Change-Id: I7d513791f86580ce31732692cba851542109fc03 git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69720 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index 74d868c..cd73f97 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -168,6 +168,7 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ { evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + edje_object_part_unswallow(wd->panes, sub); wd->contents.left = NULL; _sizing_eval(obj); } @@ -175,12 +176,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ { evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + edje_object_part_unswallow(wd->panes, sub); wd->contents.right= NULL; _sizing_eval(obj); } } - static void _clicked(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED__, const char *source __UNUSED__) { @@ -218,15 +219,15 @@ static void _content_left_set(Evas_Object *obj, Evas_Object *content) { Widget_Data *wd = elm_widget_data_get(obj); + if (wd->contents.left == content) return; if (wd->contents.left) { evas_object_del(wd->contents.left); - wd->contents.left = NULL; edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); } + wd->contents.left = content; if (content) { - wd->contents.left = content; elm_widget_sub_object_add(obj, content); edje_object_part_swallow(wd->panes, "elm.swallow.left", content); if (wd->contents.right) @@ -238,15 +239,15 @@ static void _content_right_set(Evas_Object *obj, Evas_Object *content) { Widget_Data *wd = elm_widget_data_get(obj); + if (wd->contents.right == content) return; if (wd->contents.right) { evas_object_del(wd->contents.right); - wd->contents.right = NULL; edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); } + wd->contents.right = content; if (content) { - wd->contents.right = content; elm_widget_sub_object_add(obj, content); edje_object_part_swallow(wd->panes, "elm.swallow.right", content); if (wd->contents.left) @@ -260,11 +261,7 @@ _content_left_unset(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd->contents.left) return NULL; Evas_Object *content = wd->contents.left; - - edje_object_part_unswallow(wd->panes, content); - evas_object_hide(wd->contents.left); elm_widget_sub_object_del(obj, content); - wd->contents.left = NULL; edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); return content; } @@ -275,11 +272,7 @@ _content_right_unset(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd->contents.right) return NULL; Evas_Object *content = wd->contents.right; - - edje_object_part_unswallow(wd->panes, content); - evas_object_hide(wd->contents.right); elm_widget_sub_object_del(obj, content); - wd->contents.right = NULL; edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); return content; }