elm genlist: Clear last_selected_item when last_selected_item is
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 13 Oct 2011 03:47:57 +0000 (03:47 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 13 Oct 2011 03:47:57 +0000 (03:47 +0000)
deleted.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64031 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c

index 574443a..f91b1ab 100644 (file)
@@ -1702,6 +1702,15 @@ _item_label_hook(Elm_Genlist_Item *it, const char *part)
 }
 
 static void
+_item_del_hook(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+   Elm_Genlist_Item *it = event_info;
+   if (!it) return;
+   if (it->wd->last_selected_item == it)
+     it->wd->last_selected_item = NULL;
+}
+
+static void
 _item_label_realize(Elm_Genlist_Item *it,
                     Evas_Object *target,
                     Eina_List **source)
@@ -3158,6 +3167,7 @@ _item_new(Widget_Data                  *wd,
    it->mouse_cursor = NULL;
    it->expanded_depth = 0;
    elm_widget_item_text_get_hook_set(it, _item_label_hook);
+   elm_widget_item_del_cb_set(it, _item_del_hook);
 
    if (it->parent)
      {