summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-24 00:46:43 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-24 00:51:01 +0900
commit7a25d86ce4874b651339f55593240c37d6bc4fec (patch)
tree086de0687569d329ed8adaeff085bc4272f3ec17
parentb0089c7017025f9e6cf5b7e8d8e7be5206929934 (diff)
list: Fixed item multi/single selection routine to skip disabled item correctly.
@fix
-rw-r--r--src/lib/elm_list.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index a6d6a6230..c71ebc3e3 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -91,6 +91,11 @@ _item_multi_select_up(Elm_List_Smart_Data *sd)
91 if (!sd->multi) return EINA_FALSE; 91 if (!sd->multi) return EINA_FALSE;
92 92
93 prev = elm_list_item_prev(sd->last_selected_item); 93 prev = elm_list_item_prev(sd->last_selected_item);
94 while (prev)
95 {
96 if (!elm_object_item_disabled_get(prev)) break;
97 prev = elm_list_item_prev(prev);
98 }
94 if (!prev) return EINA_TRUE; 99 if (!prev) return EINA_TRUE;
95 100
96 if (elm_list_item_selected_get(prev)) 101 if (elm_list_item_selected_get(prev))
@@ -116,6 +121,11 @@ _item_multi_select_down(Elm_List_Smart_Data *sd)
116 if (!sd->multi) return EINA_FALSE; 121 if (!sd->multi) return EINA_FALSE;
117 122
118 next = elm_list_item_next(sd->last_selected_item); 123 next = elm_list_item_next(sd->last_selected_item);
124 while (next)
125 {
126 if (!elm_object_item_disabled_get(next)) break;
127 next = elm_list_item_next(next);
128 }
119 if (!next) return EINA_TRUE; 129 if (!next) return EINA_TRUE;
120 130
121 if (elm_list_item_selected_get(next)) 131 if (elm_list_item_selected_get(next))
@@ -149,16 +159,17 @@ _item_single_select_up(Elm_List_Smart_Data *sd)
149{ 159{
150 Elm_Object_Item *prev; 160 Elm_Object_Item *prev;
151 161
152 if (!sd->selected) prev = eina_list_data_get(eina_list_last(sd->items)); 162 if (!sd->selected)
163 prev = eina_list_data_get(eina_list_last(sd->items));
153 else 164 else
165 prev = elm_list_item_prev(sd->last_selected_item);
166
167 while (prev)
154 { 168 {
155 prev = elm_list_item_prev(sd->last_selected_item); 169 if (!elm_object_item_disabled_get(prev)) break;
156 while (prev) 170 prev = elm_list_item_prev(prev);
157 {
158 if (!elm_object_item_disabled_get(prev)) break;
159 prev = elm_list_item_prev(prev);
160 }
161 } 171 }
172
162 if (!prev) return EINA_FALSE; 173 if (!prev) return EINA_FALSE;
163 174
164 _all_items_unselect(sd); 175 _all_items_unselect(sd);
@@ -174,16 +185,17 @@ _item_single_select_down(Elm_List_Smart_Data *sd)
174{ 185{
175 Elm_Object_Item *next; 186 Elm_Object_Item *next;
176 187
177 if (!sd->selected) next = eina_list_data_get(sd->items); 188 if (!sd->selected)
189 next = eina_list_data_get(sd->items);
178 else 190 else
191 next = elm_list_item_next(sd->last_selected_item);
192
193 while (next)
179 { 194 {
180 next = elm_list_item_next(sd->last_selected_item); 195 if (!elm_object_item_disabled_get(next)) break;
181 while (next) 196 next = elm_list_item_next(next);
182 {
183 if (!elm_object_item_disabled_get(next)) break;
184 next = elm_list_item_next(next);
185 }
186 } 197 }
198
187 if (!next) return EINA_FALSE; 199 if (!next) return EINA_FALSE;
188 200
189 _all_items_unselect(sd); 201 _all_items_unselect(sd);