genlist: fix genlist multi-selected problem.
authorChunEon Park <hermet@hermet.pe.kr>
Mon, 19 Jan 2015 06:26:21 +0000 (15:26 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Mon, 19 Jan 2015 06:33:06 +0000 (15:33 +0900)
user request was ignored if they calls the genlist_item_selected_set(true)
to another item in an item selected callback. because genlist made
the selected item highlighted after user "selected" callback.

The behavior had been changed on my genlist refactoring,
so the behavior was actually just restored.

This issue resolves T2020

src/lib/elm_genlist.c

index 10c9162..fd80482 100644 (file)
@@ -5680,6 +5680,12 @@ _item_select(Elm_Gen_Item *it)
      }
 
    evas_object_ref(obj);
+
+   elm_object_item_focus_set(eo_it, EINA_TRUE);
+   _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
+   sd->last_selected_item = eo_it;
+   _item_highlight(it);
+
    it->walking++;
    if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it);
    // delete item if it's requested deletion in the above callbacks.
@@ -5689,12 +5695,6 @@ _item_select(Elm_Gen_Item *it)
    if ((it->base)->on_deletion) goto item_deleted;
    it->walking--;
 
-   elm_object_item_focus_set(eo_it, EINA_TRUE);
-   _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
-
-   sd->last_selected_item = eo_it;
-   _item_highlight(it);
-
    if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
      {
         Evas_Object *swallow_obj;