summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-14 00:26:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-14 14:04:39 +0900
commitfbe72f6e4bf3813a61fa166635cf5f048d318d08 (patch)
treeed403904447cb31506ec9a80090ee1c9c0299e4f
parent7072fbc2bfe25881c1ba76bb5be0a6a01cea4539 (diff)
genlist: Fix some more decorate mode issues
The item, after having been unswallowed from its decorate item, becomes unclipped and unparented. The parent was well reset, but the clip wasn't. Test case: elementary_test -to "Genlist Decorate Item Mode" I'm sure some bugs are still lurking. Genlist is so lovely. Fixes T1551
-rw-r--r--src/lib/elementary/elm_genlist.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index b408dbbbb3..f592dbb9d7 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -3194,7 +3194,7 @@ _elm_genlist_elm_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, Elm_Genlist_D
3194EOLIAN static Eina_Bool 3194EOLIAN static Eina_Bool
3195_elm_genlist_elm_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED, Evas_Object *sobj) 3195_elm_genlist_elm_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED, Evas_Object *sobj)
3196{ 3196{
3197 Eina_Bool int_ret = EINA_FALSE; 3197 // FIXME: THIS COMMENT IS INVALID! WE ARE NOT SKIPPING ELM_LAYOUT!
3198 3198
3199 /* skipping layout's code, which registers size hint changing 3199 /* skipping layout's code, which registers size hint changing
3200 * callback on sub objects. this is here because items' 3200 * callback on sub objects. this is here because items'
@@ -3202,10 +3202,7 @@ _elm_genlist_elm_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSE
3202 * creation, thus issuing TOO MANY sizing_eval()'s here. they are 3202 * creation, thus issuing TOO MANY sizing_eval()'s here. they are
3203 * not needed at here anyway, so let's skip listening to those 3203 * not needed at here anyway, so let's skip listening to those
3204 * hints changes */ 3204 * hints changes */
3205 int_ret = elm_obj_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj); 3205 return elm_obj_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj);
3206 if (!int_ret) return EINA_FALSE;
3207
3208 return EINA_TRUE;
3209} 3206}
3210 3207
3211EOLIAN static Eina_Bool 3208EOLIAN static Eina_Bool
@@ -3213,6 +3210,7 @@ _elm_genlist_elm_widget_sub_object_del(Eo *obj, Elm_Genlist_Data *sd, Evas_Objec
3213{ 3210{
3214 Eina_Bool int_ret = EINA_FALSE; 3211 Eina_Bool int_ret = EINA_FALSE;
3215 3212
3213 // FIXME: THIS COMMENT IS INVALID! WE ARE NOT SKIPPING ELM_LAYOUT!
3216 3214
3217 /* XXX: hack -- also skipping sizing recalculation on 3215 /* XXX: hack -- also skipping sizing recalculation on
3218 * sub-object-del. genlist's crazy code paths (like groups and 3216 * sub-object-del. genlist's crazy code paths (like groups and
@@ -5100,7 +5098,7 @@ _scroll_hold_timer_cb(void *data)
5100} 5098}
5101 5099
5102static void 5100static void
5103_decorate_item_unrealize(Elm_Gen_Item *it) 5101_decorate_item_unrealize(Elm_Gen_Item *it, Eina_Bool state_update)
5104{ 5102{
5105 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 5103 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
5106 Evas_Object *obj = sd->obj; 5104 Evas_Object *obj = sd->obj;
@@ -5113,11 +5111,18 @@ _decorate_item_unrealize(Elm_Gen_Item *it)
5113 &(it->item->deco_it_contents)); 5111 &(it->item->deco_it_contents));
5114 5112
5115 edje_object_part_unswallow(it->item->deco_it_view, VIEW(it)); 5113 edje_object_part_unswallow(it->item->deco_it_view, VIEW(it));
5116 evas_object_smart_member_add(VIEW(it), sd->pan_obj);
5117 ELM_SAFE_FREE(it->item->deco_it_view, evas_object_del); 5114 ELM_SAFE_FREE(it->item->deco_it_view, evas_object_del);
5115 evas_object_smart_member_add(VIEW(it), sd->pan_obj);
5116 evas_object_clip_set(VIEW(it), evas_object_clip_get(sd->pan_obj));
5117 if (state_update)
5118 {
5119 _elm_genlist_item_state_update(it);
5120 _item_order_update(it, it->item->order_num_in, EINA_TRUE);
5121 }
5122
5123 if (sd->mode_item != it)
5124 it->decorate_it_set = EINA_FALSE;
5118 5125
5119 if (sd->mode_item == it)
5120 sd->mode_item = NULL;
5121 evas_event_thaw(evas_object_evas_get(obj)); 5126 evas_event_thaw(evas_object_evas_get(obj));
5122 evas_event_thaw_eval(evas_object_evas_get(obj)); 5127 evas_event_thaw_eval(evas_object_evas_get(obj));
5123} 5128}
@@ -5145,7 +5150,7 @@ _decorate_item_finished_signal_cb(void *data,
5145 edje_object_signal_callback_del_full 5150 edje_object_signal_callback_del_full
5146 (it->item->deco_it_view, buf, "elm", _decorate_item_finished_signal_cb, it); 5151 (it->item->deco_it_view, buf, "elm", _decorate_item_finished_signal_cb, it);
5147 it->item->nocache_once = EINA_FALSE; 5152 it->item->nocache_once = EINA_FALSE;
5148 _decorate_item_unrealize(it); 5153 _decorate_item_unrealize(it, EINA_TRUE);
5149 if (it->item->group_item) 5154 if (it->item->group_item)
5150 evas_object_stack_above(it->item->VIEW(group_item), sd->stack[1]); 5155 evas_object_stack_above(it->item->VIEW(group_item), sd->stack[1]);
5151 5156
@@ -5167,7 +5172,7 @@ _item_unrealize(Elm_Gen_Item *it)
5167 _elm_access_widget_item_unregister(it->base); 5172 _elm_access_widget_item_unregister(it->base);
5168 5173
5169 // unswallow VIEW(it) first then manipulate VIEW(it) 5174 // unswallow VIEW(it) first then manipulate VIEW(it)
5170 _decorate_item_unrealize(it); 5175 _decorate_item_unrealize(it, EINA_FALSE);
5171 if (it->item->wsd->decorate_all_mode) _decorate_all_item_unrealize(it); 5176 if (it->item->wsd->decorate_all_mode) _decorate_all_item_unrealize(it);
5172 5177
5173 if (!_item_cache_add(it, _content_cache_add(it, &cache))) 5178 if (!_item_cache_add(it, _content_cache_add(it, &cache)))