elm_index: set selected item active in smart theme
authorJaeun Choi <jaeun12.choi@samsung.com>
Mon, 4 Mar 2013 08:55:48 +0000 (17:55 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 4 Mar 2013 08:55:48 +0000 (17:55 +0900)
This patch sets selected item's state active when theme is changed.

legacy/elementary/ChangeLog
legacy/elementary/NEWS
legacy/elementary/src/lib/elm_index.c

index 8d47aee..648352f 100644 (file)
 
         * Fix the standard of scrollbar-calculation from the scroller's x to pan's x.
         The scrollbar have to sync with pan. if not, the scrollbar doesn't move even if the position of content moves.
+
+2013-03-04  Jaeun Choi
+
+        * Fix elm_index to send a signal to the selected item in smart theme.
index 9ee79d9..7efb1ba 100644 (file)
@@ -164,6 +164,7 @@ Fixes:
    * Fix scroller acceleration bug. It was accelerated even it's scrolled after finishing the previous scroll. This happens with page scroll enabled.
    * Fix 1byte invalid read & do memset, rewind if needed.
    * Fix the standard of scrollbar-calculation from the scroller's x to pan's x.
+   * Fix elm_index to send a signal to the selected item in smart theme.
    
 Removals:
 
index 6b0ce03..597d5b6 100644 (file)
@@ -316,6 +316,8 @@ static void
 _elm_index_smart_theme(Eo *obj, void *_pd, va_list *list)
 {
    Evas_Coord minw = 0, minh = 0;
+   Elm_Index_Item *it;
+
    Eina_Bool *ret = va_arg(*list, Eina_Bool *);
    if (ret) *ret = EINA_FALSE;
    Eina_Bool int_ret = EINA_FALSE;
@@ -385,6 +387,15 @@ _elm_index_smart_theme(Eo *obj, void *_pd, va_list *list)
      }
    else elm_layout_signal_emit(obj, "elm,state,inactive", "elm");
 
+   it = (Elm_Index_Item *)elm_index_selected_item_get(obj, sd->level);
+   if (it)
+     {
+        if (it->head)
+          edje_object_signal_emit(VIEW(it->head), "elm,state,active", "elm");
+        else
+          edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
+     }
+
    if (ret) *ret = EINA_TRUE;
 }
 
@@ -863,21 +874,18 @@ _index_resize_cb(void *data,
 
    if (!sd->omit_enabled) return;
 
-   Eina_List *l;
    Elm_Index_Item *it;
 
    _index_box_clear(data, sd->bx[0], 0);
    _index_box_auto_fill(data, sd->bx[0], 0);
 
-   EINA_LIST_FOREACH(sd->items, l, it)
+   it = (Elm_Index_Item *)elm_index_selected_item_get(obj, sd->level);
+   if (it)
      {
-        if (it->selected)
-          {
-             if (it->head)
-               edje_object_signal_emit(VIEW(it->head), "elm,state,active", "elm");
-             else
-               edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
-          }
+        if (it->head)
+          edje_object_signal_emit(VIEW(it->head), "elm,state,active", "elm");
+        else
+          edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
      }
 }