summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-03-29 07:08:22 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-03-29 07:08:22 +0000
commit9bd243f89dd210dfd0e0f14a3ac8c8e6396c477b (patch)
tree7ed5c1ad32c01fc1a71e2782ed7b1db6aa78e365 /legacy/elementary
parentff7dbb7a735216e805db8c74e9f820e307749353 (diff)
elementary/panes - Patch to handle deletion of current contents while setting new ones
Attached to the mail is a patch for elm_panes. I have a query that shall we hide the unset content in the widget itself or should application explicitly hide them after unsetting! In case of edje_object_part_unswallow, application needs to do it explicitly and it is documented but in case of elm_object_part_content_unset, there is no documentation available. Details of the patch: Existing Issue before this change: 1. Panes deletes the older content while setting a new content even though both are same. 2. left and right content are being unswallowed in the content_left_set and _content_right_unset functions. So when the reparenting happens, say when the content is put inside a layout then only _sub_del gets called and unswallowing does not happen as these functions do not get called. e.g. @@ -253,8 +250,6 @@ _content_left_unset(Evas_Object *obj) if (!wd->contents.left) return NULL; Evas_Object *content = wd->contents.left; elm_widget_sub_object_del(obj, content); //wd->contents.left already gets set to NULL in _sub_del - edje_object_part_unswallow(wd->panes, content); // can be unswallowed in _sub_del as in case of reparenting like setting content in a layout, only _sub_del will get called, not this function - wd->contents.left = NULL; //this instruction is redundent as it happens in _sub_del anyway return content; } 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<rajeev.r@samsumg.com> Thanks. Regards, Rajeev SVN revision: 69720
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elm_panes.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/legacy/elementary/src/lib/elm_panes.c b/legacy/elementary/src/lib/elm_panes.c
index 605740cc37..3fc102a32f 100644
--- a/legacy/elementary/src/lib/elm_panes.c
+++ b/legacy/elementary/src/lib/elm_panes.c
@@ -166,6 +166,7 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __
166 { 166 {
167 evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 167 evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
168 _changed_size_hints, obj); 168 _changed_size_hints, obj);
169 edje_object_part_unswallow(wd->panes, sub);
169 wd->contents.left = NULL; 170 wd->contents.left = NULL;
170 _sizing_eval(obj); 171 _sizing_eval(obj);
171 } 172 }
@@ -173,12 +174,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __
173 { 174 {
174 evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 175 evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
175 _changed_size_hints, obj); 176 _changed_size_hints, obj);
177 edje_object_part_unswallow(wd->panes, sub);
176 wd->contents.right= NULL; 178 wd->contents.right= NULL;
177 _sizing_eval(obj); 179 _sizing_eval(obj);
178 } 180 }
179} 181}
180 182
181
182static void 183static void
183_clicked(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED__, const char *source __UNUSED__) 184_clicked(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED__, const char *source __UNUSED__)
184{ 185{
@@ -216,14 +217,12 @@ static void
216_content_left_set(Evas_Object *obj, Evas_Object *content) 217_content_left_set(Evas_Object *obj, Evas_Object *content)
217{ 218{
218 Widget_Data *wd = elm_widget_data_get(obj); 219 Widget_Data *wd = elm_widget_data_get(obj);
220 if (wd->contents.left == content) return;
219 if (wd->contents.left) 221 if (wd->contents.left)
220 { 222 evas_object_del(wd->contents.left);
221 evas_object_del(wd->contents.left); 223 wd->contents.left = content;
222 wd->contents.left = NULL;
223 }
224 if (content) 224 if (content)
225 { 225 {
226 wd->contents.left = content;
227 elm_widget_sub_object_add(obj, content); 226 elm_widget_sub_object_add(obj, content);
228 edje_object_part_swallow(wd->panes, "elm.swallow.left", content); 227 edje_object_part_swallow(wd->panes, "elm.swallow.left", content);
229 } 228 }
@@ -233,14 +232,12 @@ static void
233_content_right_set(Evas_Object *obj, Evas_Object *content) 232_content_right_set(Evas_Object *obj, Evas_Object *content)
234{ 233{
235 Widget_Data *wd = elm_widget_data_get(obj); 234 Widget_Data *wd = elm_widget_data_get(obj);
235 if (wd->contents.right == content) return;
236 if (wd->contents.right) 236 if (wd->contents.right)
237 { 237 evas_object_del(wd->contents.right);
238 evas_object_del(wd->contents.right); 238 wd->contents.right = content;
239 wd->contents.right = NULL;
240 }
241 if (content) 239 if (content)
242 { 240 {
243 wd->contents.right = content;
244 elm_widget_sub_object_add(obj, content); 241 elm_widget_sub_object_add(obj, content);
245 edje_object_part_swallow(wd->panes, "elm.swallow.right", content); 242 edje_object_part_swallow(wd->panes, "elm.swallow.right", content);
246 } 243 }
@@ -253,8 +250,6 @@ _content_left_unset(Evas_Object *obj)
253 if (!wd->contents.left) return NULL; 250 if (!wd->contents.left) return NULL;
254 Evas_Object *content = wd->contents.left; 251 Evas_Object *content = wd->contents.left;
255 elm_widget_sub_object_del(obj, content); 252 elm_widget_sub_object_del(obj, content);
256 edje_object_part_unswallow(wd->panes, content);
257 wd->contents.left = NULL;
258 return content; 253 return content;
259} 254}
260 255
@@ -265,8 +260,6 @@ _content_right_unset(Evas_Object *obj)
265 if (!wd->contents.right) return NULL; 260 if (!wd->contents.right) return NULL;
266 Evas_Object *content = wd->contents.right; 261 Evas_Object *content = wd->contents.right;
267 elm_widget_sub_object_del(obj, content); 262 elm_widget_sub_object_del(obj, content);
268 edje_object_part_unswallow(wd->panes, content);
269 wd->contents.right = NULL;
270 return content; 263 return content;
271} 264}
272 265