From: Enlightenment S. <no-...@en...> - 2008-11-21 05:36:11
|
Log: A little shuffling around and ilist is a bit nicer with thumbscroll. If I broke it at all, let me know. I believe I tested everything though. Author: mekius Date: 2008-11-20 21:36:08 -0800 (Thu, 20 Nov 2008) New Revision: 37723 Modified: trunk/e/src/bin/e_ilist.c Modified: trunk/e/src/bin/e_ilist.c =================================================================== --- trunk/e/src/bin/e_ilist.c 2008-11-21 04:35:26 UTC (rev 37722) +++ trunk/e/src/bin/e_ilist.c 2008-11-21 05:36:08 UTC (rev 37723) @@ -935,8 +935,6 @@ E_Smart_Data *sd; Evas_Event_Mouse_Down *ev; E_Ilist_Item *si; - Eina_List *l = NULL; - int i; ev = event_info; si = data; @@ -948,26 +946,6 @@ /* NB: Remove if headers ever become selectable */ if (si->header) return; - if (!sd->items) return; - for (i = 0, l = sd->items; l; l = l->next, i++) - { - if (l->data == si) - { - if (!sd->multi_select) - e_ilist_selected_set(sd->o_smart, i); - else - { - if (evas_key_modifier_is_set(ev->modifiers, "Shift")) - e_ilist_range_select(sd->o_smart, i); - else if (evas_key_modifier_is_set(ev->modifiers, "Control")) - e_ilist_multi_select(sd->o_smart, i); - else - e_ilist_selected_set(sd->o_smart, i); - } - break; - } - } - if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) evas_object_smart_callback_call(sd->o_smart, "selected", NULL); } @@ -978,6 +956,8 @@ E_Smart_Data *sd; Evas_Event_Mouse_Up *ev; E_Ilist_Item *si; + Eina_List *l = NULL; + int i; ev = event_info; si = data; @@ -989,13 +969,35 @@ /* NB: Remove if headers ever become selectable */ if (si->header) return; - if ((!sd->items) || (!sd->selector)) return; - if (!(si = eina_list_nth(sd->items, sd->selected))) return; if (sd->on_hold) { sd->on_hold = 0; return; } + + if ((!sd->items)) return; + + for (i = 0, l = sd->items; l; l = l->next, i++) + { + if (l->data == si) + { + if (!sd->multi_select) + e_ilist_selected_set(sd->o_smart, i); + else + { + if (evas_key_modifier_is_set(ev->modifiers, "Shift")) + e_ilist_range_select(sd->o_smart, i); + else if (evas_key_modifier_is_set(ev->modifiers, "Control")) + e_ilist_multi_select(sd->o_smart, i); + else + e_ilist_selected_set(sd->o_smart, i); + } + break; + } + } + + if(!sd->selector) return; + if (!(si = eina_list_nth(sd->items, sd->selected))) return; if (si->func) si->func(si->data, si->data2); } |