I removed some unnecessary lines from elm_index.c  
 
1. in _index_box_auto_fill  
_index_box_clear(line 178) does nothing:  
if _index_box_clear is called, it means sd->level_active[level] is false 
(line 116).  
if sd->level_active[level] is false, _index_box_clear returns immediately 
(line 60).  
 
2. in _on_mouse_down  
3. in _on_mouse_in_access

4. in _autohide_disabled_set  
Signal emit is enough.
Filling the box and displaying the box are separated jobs.
I think it's logically consistent to fill the box only when  
1) elm_index_level_go is called  
2) theme is changed  
 
5. in _level_go

Always clear the box before fill the box.
 
--  
Jaeun Choi
Index: src/lib/elm_index.c
===================================================================
--- src/lib/elm_index.c	(revision 82689)
+++ src/lib/elm_index.c	(working copy)
@@ -30,7 +30,7 @@ _item_free(Elm_Index_Item *it)
    ELM_INDEX_DATA_GET(WIDGET(it), sd);
 
    sd->items = eina_list_remove(sd->items, it);
-   if (it->letter) 
+   if (it->letter)
      {
         eina_stringshare_del(it->letter);
         it->letter = NULL;
@@ -171,16 +171,6 @@ _index_box_auto_fill(Evas_Object *obj,
         evas_object_show(o);
 
         i++;
-        evas_object_smart_calculate(box); // force a calc so we know the size
-        evas_object_size_hint_min_get(box, &mw, &mh);
-        if (mh > h)
-          {
-             _index_box_clear(obj, box, level);
-             if (i > 0)
-               {
-                  // FIXME: only i objects fit! try again. overflows right now
-               }
-          }
 
         // ACCESS
         if ((it->level == 0) &&
@@ -510,7 +500,6 @@ _on_mouse_down(void *data,
    if (!sd->autohide_disabled)
      {
         _index_box_clear(data, sd->bx[1], 1);
-        _index_box_auto_fill(data, sd->bx[0], 0);
         elm_layout_signal_emit(data, "elm,state,active", "elm");
      }
    _sel_eval(data, ev->canvas.x, ev->canvas.y);
@@ -615,7 +604,6 @@ _on_mouse_in_access(void *data,
    if (!sd->autohide_disabled)
      {
         _index_box_clear(data, sd->bx[1], 1);
-        _index_box_auto_fill(data, sd->bx[0], 0);
         elm_layout_signal_emit(data, "elm,state,active", "elm");
      }
 }
@@ -926,7 +914,6 @@ _autohide_disabled_set(Eo *obj, void *_pd, va_list
    if (sd->autohide_disabled)
      {
         _index_box_clear(obj, sd->bx[1], 1);
-        _index_box_auto_fill(obj, sd->bx[0], 0);
         elm_layout_signal_emit(obj, "elm,state,active", "elm");
      }
    else
@@ -1330,8 +1317,13 @@ _level_go(Eo *obj, void *_pd, va_list *list)
    int level = va_arg(*list, int);
    (void) level;
    Elm_Index_Smart_Data *sd = _pd;
+   _index_box_clear(obj, sd->bx[0], 0);
    _index_box_auto_fill(obj, sd->bx[0], 0);
-   if (sd->level == 1) _index_box_auto_fill(obj, sd->bx[1], 1);
+   if (sd->level == 1)
+     {
+        _index_box_clear(obj, sd->bx[1], 1);
+        _index_box_auto_fill(obj, sd->bx[1], 1);
+     }
 }
 
 EAPI void
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to