summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-16 17:50:11 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-16 17:50:11 +0900
commitbe19d76a2ce0ef9f4107e76a188cc17cf5f19301 (patch)
treec18ee581a3f6195447a1659346da17390bf97683 /src
parenta407689372b2cd085c4220cdc3b82fb811b87307 (diff)
list - fix item disable and infinite loop on next select
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_list.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 34137419b..984225d80 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1025,8 +1025,9 @@ _item_unhighlight(Elm_List_Item *it)
1025 obj = WIDGET(it); 1025 obj = WIDGET(it);
1026 ELM_LIST_DATA_GET(obj, sd); 1026 ELM_LIST_DATA_GET(obj, sd);
1027 1027
1028 if ((!it->highlighted) || (it->base.disabled) || 1028// if ((!it->highlighted) || (it->base.disabled) ||
1029 (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return; 1029// (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return;
1030 if (!it->highlighted) return;
1030 1031
1031 evas_object_ref(obj); 1032 evas_object_ref(obj);
1032 _elm_list_walk(sd); 1033 _elm_list_walk(sd);
@@ -1055,8 +1056,8 @@ _item_unselect(Elm_List_Item *it)
1055 obj = WIDGET(it); 1056 obj = WIDGET(it);
1056 ELM_LIST_DATA_GET(obj, sd); 1057 ELM_LIST_DATA_GET(obj, sd);
1057 1058
1058 if (it->base.disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) 1059// if (it->base.disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))
1059 return; 1060// return;
1060 1061
1061 evas_object_ref(obj); 1062 evas_object_ref(obj);
1062 _elm_list_walk(sd); 1063 _elm_list_walk(sd);
@@ -1071,7 +1072,9 @@ _item_unselect(Elm_List_Item *it)
1071 { 1072 {
1072 it->selected = EINA_FALSE; 1073 it->selected = EINA_FALSE;
1073 sd->selected = eina_list_remove(sd->selected, it); 1074 sd->selected = eina_list_remove(sd->selected, it);
1074 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it); 1075 if (!(it->base.disabled ||
1076 (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)))
1077 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
1075 } 1078 }
1076 1079
1077 _elm_list_unwalk(obj, sd); 1080 _elm_list_unwalk(obj, sd);
@@ -1316,8 +1319,11 @@ _mouse_up_cb(void *data,
1316 { 1319 {
1317 while (sd->selected) 1320 while (sd->selected)
1318 { 1321 {
1319 _item_unhighlight(sd->selected->data); 1322 Elm_List_Item *it2 = sd->selected->data;
1320 _item_unselect(sd->selected->data); 1323 sd->selected = eina_list_remove_list
1324 (sd->selected, sd->selected);
1325 _item_unhighlight(it2);
1326 _item_unselect(it2);
1321 } 1327 }
1322 _item_highlight(it); 1328 _item_highlight(it);
1323 _item_select(it); 1329 _item_select(it);
@@ -1347,6 +1353,8 @@ _item_disable_hook(Elm_Object_Item *it)
1347{ 1353{
1348 Elm_List_Item *item = (Elm_List_Item *)it; 1354 Elm_List_Item *item = (Elm_List_Item *)it;
1349 1355
1356 _item_unhighlight(item);
1357 _item_unselect(item);
1350 if (item->base.disabled) 1358 if (item->base.disabled)
1351 edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm"); 1359 edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm");
1352 else 1360 else