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:48:11 +0900
commiteb69708e9131a5b3686309862cd20d9ab45ce339 (patch)
tree34b23ce81dd44930c4ca72457e9d7de1e63e1700
parented32e86fd8fba9893fca48ded43ab83c41a16e2e (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 447ce9d7f..9b7212a08 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -95,6 +95,11 @@ _item_multi_select_up(Elm_List_Smart_Data *sd)
95 if (!sd->multi) return EINA_FALSE; 95 if (!sd->multi) return EINA_FALSE;
96 96
97 prev = elm_list_item_prev(sd->last_selected_item); 97 prev = elm_list_item_prev(sd->last_selected_item);
98 while (prev)
99 {
100 if (!elm_object_item_disabled_get(prev)) break;
101 prev = elm_list_item_prev(prev);
102 }
98 if (!prev) return EINA_TRUE; 103 if (!prev) return EINA_TRUE;
99 104
100 if (elm_list_item_selected_get(prev)) 105 if (elm_list_item_selected_get(prev))
@@ -118,6 +123,11 @@ _item_multi_select_down(Elm_List_Smart_Data *sd)
118 if (!sd->multi) return EINA_FALSE; 123 if (!sd->multi) return EINA_FALSE;
119 124
120 next = elm_list_item_next(sd->last_selected_item); 125 next = elm_list_item_next(sd->last_selected_item);
126 while (next)
127 {
128 if (!elm_object_item_disabled_get(next)) break;
129 next = elm_list_item_next(next);
130 }
121 if (!next) return EINA_TRUE; 131 if (!next) return EINA_TRUE;
122 132
123 if (elm_list_item_selected_get(next)) 133 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);
@@ -173,16 +184,17 @@ _item_single_select_down(Elm_List_Smart_Data *sd)
173{ 184{
174 Elm_Object_Item *next; 185 Elm_Object_Item *next;
175 186
176 if (!sd->selected) next = eina_list_data_get(sd->items); 187 if (!sd->selected)
188 next = eina_list_data_get(sd->items);
177 else 189 else
190 next = elm_list_item_next(sd->last_selected_item);
191
192 while (next)
178 { 193 {
179 next = elm_list_item_next(sd->last_selected_item); 194 if (!elm_object_item_disabled_get(next)) break;
180 while (next) 195 next = elm_list_item_next(next);
181 {
182 if (!elm_object_item_disabled_get(next)) break;
183 next = elm_list_item_next(next);
184 }
185 } 196 }
197
186 if (!next) return EINA_FALSE; 198 if (!next) return EINA_FALSE;
187 199
188 _all_items_unselect(sd); 200 _all_items_unselect(sd);