I make new one using _item_position and resolved blank bug.
Please review again.

Thanks
Joey

2012/3/21 Daniel Juyung Seo <seojuyu...@gmail.com>

> I got issue when I applied this patch.
> When I expanded items in the lower part, I got some blank items after
> auto scrolling.
> Can you please fix this?
>
> And I have one comment.
>
> Instead of this,
> > evas_object_resize(VIEW(it), it->item->w, it->item->h);
> > evas_object_move(VIEW(it), it->item->scrl_x, it->item->scrl_y);
> > evas_object_show(VIEW(it));
>
> You can use _item_position().
> Thank you.
>
> Daniel Juyung Seo (SeoZ)
>
> On Mon, Mar 19, 2012 at 4:27 PM, chanwook jung <jchanw...@gmail.com>
> wrote:
> > Dear all,
> >
> > I found some bugs in tree effect. flickering, emit signal to unrealize
> > item... so I fix it.
> >
> > Thanks,
> > Chanwook
> >
> >
> ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c	(revision 69556)
+++ src/lib/elm_genlist.c	(working copy)
@@ -77,6 +77,7 @@ struct Elm_Gen_Item_Type
    Eina_Bool                     move_effect_enabled : 1;
    Eina_Bool                     decorate_mode_item_realized : 1;
    Eina_Bool                     tree_effect_finished : 1; /* tree effect */
+   Eina_Bool                     tree_effect_hideme : 1; /* item hide for tree effect */
 };
 
 struct _Item_Block
@@ -2179,7 +2180,15 @@ _item_realize(Elm_Gen_Item *it,
    //evas_event_thaw(evas_object_evas_get(it->wd->obj));
    //evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
    if (!calc)
-     evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
+     {
+        if (it->item->tree_effect_hideme)
+          {
+             if (it->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE)
+               edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
+             it->item->tree_effect_hideme = EINA_FALSE;
+          }
+        evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
+     }
 
    if ((!calc) && (it->wd->decorate_mode) && (it->item->type != ELM_GENLIST_ITEM_GROUP))
      {
@@ -2481,13 +2490,19 @@ _item_block_position(Item_Block *itb,
                                                        it->item->scrl_y);
                             else
                               {
-                                 if (it->item->mode_view)
-                                   _item_position(it, it->item->mode_view,
-                                                  it->item->scrl_x,
-                                                  it->item->scrl_y);
-                                 else
-                                   _item_position(it, VIEW(it), it->item->scrl_x,
-                                                  it->item->scrl_y);
+                                 if (!it->wd->tree_effect_enabled ||
+                                     (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE) ||
+                                     ((it->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE) &&
+                                     (it->item->old_scrl_y == it->item->scrl_y)))
+                                   {
+                                      if (it->item->mode_view)
+                                        _item_position(it, it->item->mode_view,
+                                                       it->item->scrl_x,
+                                                       it->item->scrl_y);
+                                      else
+                                        _item_position(it, VIEW(it), it->item->scrl_x,
+                                                       it->item->scrl_y);
+                                   }
                               }
                             it->item->old_scrl_y = it->item->scrl_y;
                          }
@@ -3000,6 +3015,19 @@ _pan_calculate(Evas_Object *obj)
      {
         git->item->want_realize = EINA_FALSE;
      }
+
+   if (sd->wd->tree_effect_enabled && (sd->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE))
+     {
+        if (!sd->wd->tree_effect_animator)
+          {
+             _item_tree_effect_before(sd->wd->expanded_item);
+             evas_object_raise(sd->wd->alpha_bg);
+             evas_object_show(sd->wd->alpha_bg);
+             sd->wd->start_time = ecore_time_get();
+             sd->wd->tree_effect_animator = ecore_animator_add(_tree_effect_animator_cb, sd->wd);
+          }
+     }
+
    EINA_INLIST_FOREACH(sd->wd->blocks, itb)
      {
         itb->w = sd->wd->minw;
@@ -3030,18 +3058,7 @@ _pan_calculate(Evas_Object *obj)
         sd->wd->start_time = ecore_loop_time_get();
      }
 
-   if (sd->wd->tree_effect_enabled && (sd->wd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE))
-     {
-        if (!sd->wd->tree_effect_animator)
-          {
-             _item_tree_effect_before(sd->wd->expanded_item);
-             evas_object_raise(sd->wd->alpha_bg);
-             evas_object_show(sd->wd->alpha_bg);
-             sd->wd->start_time = ecore_time_get();
-             sd->wd->tree_effect_animator = ecore_animator_add(_tree_effect_animator_cb, sd->wd);
-          }
-     }
-   else
+   if (!sd->wd->tree_effect_enabled || (sd->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE))
      _item_auto_scroll(sd->wd);
 
    evas_event_thaw(evas_object_evas_get(obj));
@@ -5879,6 +5896,8 @@ _item_tree_effect_before(Elm_Gen_Item *it)
      {
         if (it2->parent && (it == it2->parent))
           {
+             if (!it2->realized)
+               it2->item->tree_effect_hideme = EINA_TRUE;
              if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
                edje_object_signal_emit(VIEW(it2), "elm,state,hide", "");
              else if (it->wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
@@ -5900,14 +5919,17 @@ _item_tree_effect(Widget_Data *wd, int y)
         it = (Elm_Gen_Item *) elm_genlist_item_prev_get((Elm_Object_Item *) expanded_next_it);
         while (it)
           {
+/* If the realized item go to next block and the block's vis is FALSE, can not emit signal flip_item */
+             if (!it->item->scrl_y)
+               it->item->scrl_y = expanded_next_it->item->scrl_y;
              if (it->item->expanded_depth <= expanded_next_it->item->expanded_depth) break;
-             if (it->item->scrl_y && (it->item->scrl_y < expanded_next_it->item->old_scrl_y + y) &&
+             if (it->item->scrl_y && (it->item->scrl_y <= expanded_next_it->item->old_scrl_y + y) &&
                  (it->item->expanded_depth > expanded_next_it->item->expanded_depth))
                {
                   if (!it->item->tree_effect_finished)
                     {
                        edje_object_signal_emit(VIEW(it), "flip_item", "");
-                       evas_object_show(VIEW(it));
+                       _item_position(it, VIEW(it), it->item->scrl_x, it->item->scrl_y);
                        it->item->tree_effect_finished = EINA_TRUE;
                     }
                }
@@ -6006,7 +6028,7 @@ _tree_effect_animator_cb(void *data)
              if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
                {
                   expanded_next_it->item->old_scrl_y = wd->expanded_item->item->old_scrl_y + wd->expanded_item->item->h;
-                  if (expanded_next_it->item->scrl_y < expanded_next_it->item->old_scrl_y) //did not calculate next item position
+                  if (expanded_next_it->item->scrl_y <= expanded_next_it->item->old_scrl_y) //did not calculate next item position
                     expanded_next_it->item->scrl_y = cvy + cvh;
 
                   dy = ((expanded_next_it->item->scrl_y >= (cvy + cvh)) ?
@@ -6015,7 +6037,7 @@ _tree_effect_animator_cb(void *data)
                }
              else if (wd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
                {
-                  if (expanded_next_it->item->scrl_y > expanded_next_it->item->old_scrl_y) //did not calculate next item position
+                  if (expanded_next_it->item->scrl_y >= expanded_next_it->item->old_scrl_y) //did not calculate next item position
                      expanded_next_it->item->old_scrl_y = cvy + cvh;
 
                   if (expanded_next_it->item->old_scrl_y > (cvy + cvh))
@@ -6085,7 +6107,7 @@ _tree_effect_animator_cb(void *data)
                        if (t >= (((num - 1) * effect_duration) / expanded_item_num))
                          {
                             edje_object_signal_emit(VIEW(it), "flip_item", "");
-                            evas_object_show(VIEW(it));
+                            _item_position(it, VIEW(it), it->item->scrl_x, it->item->scrl_y);
                             it->item->tree_effect_finished = EINA_TRUE;
                          }
                     }
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to