summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/elementary/test_ui_collection.c4
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c4
-rw-r--r--src/lib/elementary/efl_ui_collection.c4
-rw-r--r--src/lib/elementary/efl_ui_item.c4
-rw-r--r--src/lib/elementary/efl_ui_multi_selectable.eo2
-rw-r--r--src/tests/elementary/spec/efl_test_multi_selectable.c33
6 files changed, 4 insertions, 47 deletions
diff --git a/src/bin/elementary/test_ui_collection.c b/src/bin/elementary/test_ui_collection.c
index 2dd2bc2..1cc275f 100644
--- a/src/bin/elementary/test_ui_collection.c
+++ b/src/bin/elementary/test_ui_collection.c
@@ -306,10 +306,6 @@ void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class
306 efl_text_set(o, "Singleselect"); 306 efl_text_set(o, "Singleselect");
307 efl_pack_end(bx, o); 307 efl_pack_end(bx, o);
308 o = efl_add(EFL_UI_RADIO_CLASS, bx, 308 o = efl_add(EFL_UI_RADIO_CLASS, bx,
309 efl_ui_radio_state_value_set(efl_added, EFL_UI_SELECT_MODE_SINGLE_ALWAYS));
310 efl_text_set(o, "Singleselect Always");
311 efl_pack_end(bx, o);
312 o = efl_add(EFL_UI_RADIO_CLASS, bx,
313 efl_ui_radio_state_value_set(efl_added, EFL_UI_SELECT_MODE_MULTI)); 309 efl_ui_radio_state_value_set(efl_added, EFL_UI_SELECT_MODE_MULTI));
314 efl_text_set(o, "Multiselect"); 310 efl_text_set(o, "Multiselect");
315 efl_pack_end(bx, o); 311 efl_pack_end(bx, o);
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index 5a30a8c..1666414 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -240,10 +240,6 @@ elm_main(int argc EINA_UNUSED, char **argv)
240 efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_MODE_SINGLE); 240 efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_MODE_SINGLE);
241 efl_pack_end(bbox, radio); 241 efl_pack_end(bbox, radio);
242 radio = efl_add(EFL_UI_RADIO_CLASS, wbox); 242 radio = efl_add(EFL_UI_RADIO_CLASS, wbox);
243 efl_text_set(radio, "SINGLE_ALWAYS");
244 efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_MODE_SINGLE_ALWAYS);
245 efl_pack_end(bbox, radio);
246 radio = efl_add(EFL_UI_RADIO_CLASS, wbox);
247 efl_text_set(radio, "MULTI"); 243 efl_text_set(radio, "MULTI");
248 efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_MODE_MULTI); 244 efl_ui_radio_state_value_set(radio, EFL_UI_SELECT_MODE_MULTI);
249 efl_pack_end(bbox, radio); 245 efl_pack_end(bbox, radio);
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c
index 2a666f2..1763b65 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -486,7 +486,7 @@ EOLIAN static void
486_efl_ui_collection_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, Efl_Ui_Select_Mode mode) 486_efl_ui_collection_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, Efl_Ui_Select_Mode mode)
487{ 487{
488 pd->mode = mode; 488 pd->mode = mode;
489 if ((mode == EFL_UI_SELECT_MODE_SINGLE_ALWAYS || mode == EFL_UI_SELECT_MODE_SINGLE) && 489 if ((mode == EFL_UI_SELECT_MODE_SINGLE) &&
490 eina_list_count(pd->selected) > 0) 490 eina_list_count(pd->selected) > 0)
491 { 491 {
492 Efl_Ui_Item *last = eina_list_last_data_get(pd->selected); 492 Efl_Ui_Item *last = eina_list_last_data_get(pd->selected);
@@ -569,7 +569,7 @@ _selection_changed(void *data, const Efl_Event *ev)
569 569
570 if (selection) 570 if (selection)
571 { 571 {
572 if (pd->mode == EFL_UI_SELECT_MODE_SINGLE_ALWAYS || pd->mode == EFL_UI_SELECT_MODE_SINGLE) 572 if (pd->mode == EFL_UI_SELECT_MODE_SINGLE)
573 { 573 {
574 _single_selection_behaviour(obj, pd, ev->object); 574 _single_selection_behaviour(obj, pd, ev->object);
575 } 575 }
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index bd6de1a..1b0c4f1 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -45,7 +45,7 @@ _item_select(Eo *obj, Efl_Ui_Item_Data *pd)
45 if (pd->container) 45 if (pd->container)
46 { 46 {
47 m = _fetch_state(pd->container); 47 m = _fetch_state(pd->container);
48 if (m == EFL_UI_SELECT_MODE_NONE || (pd->selected && m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS)) 48 if (m == EFL_UI_SELECT_MODE_NONE)
49 return; 49 return;
50 } 50 }
51 else 51 else
@@ -95,7 +95,7 @@ _item_unpressed(void *data, const Efl_Event *ev EINA_UNUSED)
95 efl_layout_signal_emit(obj, "efl,state,unpressed", "efl"); 95 efl_layout_signal_emit(obj, "efl,state,unpressed", "efl");
96 m = _fetch_state(pd->container); 96 m = _fetch_state(pd->container);
97 97
98 if ((m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected)) 98 if (pd->selected)
99 efl_ui_selectable_selected_set(obj, EINA_FALSE); 99 efl_ui_selectable_selected_set(obj, EINA_FALSE);
100 else if (m != EFL_UI_SELECT_MODE_NONE) 100 else if (m != EFL_UI_SELECT_MODE_NONE)
101 efl_ui_selectable_selected_set(obj, EINA_TRUE); 101 efl_ui_selectable_selected_set(obj, EINA_TRUE);
diff --git a/src/lib/elementary/efl_ui_multi_selectable.eo b/src/lib/elementary/efl_ui_multi_selectable.eo
index a130708..9b58135 100644
--- a/src/lib/elementary/efl_ui_multi_selectable.eo
+++ b/src/lib/elementary/efl_ui_multi_selectable.eo
@@ -2,8 +2,6 @@ enum @beta Efl.Ui.Select_Mode {
2 [[Type of multi selectable object.]] 2 [[Type of multi selectable object.]]
3 single, [[Only single child is selected. If a child is selected, 3 single, [[Only single child is selected. If a child is selected,
4 previous selected child will be unselected.]] 4 previous selected child will be unselected.]]
5 single_always, [[Same as single select except, this will be selected
6 in every select call even if child is already been selected.]]
7 multi, [[Allow multiple selection of children.]] 5 multi, [[Allow multiple selection of children.]]
8 none [[No child can be selected at all.]] 6 none [[No child can be selected at all.]]
9} 7}
diff --git a/src/tests/elementary/spec/efl_test_multi_selectable.c b/src/tests/elementary/spec/efl_test_multi_selectable.c
index 6f31327..770c10e 100644
--- a/src/tests/elementary/spec/efl_test_multi_selectable.c
+++ b/src/tests/elementary/spec/efl_test_multi_selectable.c
@@ -135,38 +135,6 @@ EFL_START_TEST(test_single_select)
135} 135}
136EFL_END_TEST 136EFL_END_TEST
137 137
138EFL_START_TEST(test_single_select_always)
139{
140 int c = 0;
141 Eina_Array *arr_selected;
142
143 efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE_ALWAYS);
144 efl_event_callback_add(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
145 efl_event_callback_add(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
146
147 efl_ui_selectable_selected_set(efl_pack_content_get(widget, 0), EINA_TRUE);
148 if (c == 0) efl_loop_begin(efl_main_loop_get());
149 ck_assert_int_eq(c, 1);
150 c = 0;
151 efl_ui_selectable_selected_set(efl_pack_content_get(widget, 2), EINA_TRUE);
152 if (c == 0) efl_loop_begin(efl_main_loop_get());
153 ck_assert_int_eq(c, 1);
154 c = 0;
155 efl_ui_selectable_selected_set(efl_pack_content_get(widget, 2), EINA_TRUE);
156 if (c == 0) efl_loop_begin(efl_main_loop_get());
157 ck_assert_int_eq(c, 1);
158 c = 0;
159 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE);
160 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_TRUE);
161 ck_assert_ptr_eq(efl_ui_single_selectable_last_selected_get(widget), efl_pack_content_get(widget, 2));
162 _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget));
163 ck_assert_int_eq(eina_array_count(arr_selected), 1);
164 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 2));
165 efl_event_callback_del(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
166 efl_event_callback_del(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
167}
168EFL_END_TEST
169
170EFL_START_TEST(test_none_select) 138EFL_START_TEST(test_none_select)
171{ 139{
172 Efl_Ui_Item *selected = NULL; 140 Efl_Ui_Item *selected = NULL;
@@ -290,7 +258,6 @@ efl_ui_multi_selectable_behavior_test(TCase *tc)
290 tcase_add_test(tc, test_multi_select_removal); 258 tcase_add_test(tc, test_multi_select_removal);
291 tcase_add_test(tc, test_single_select); 259 tcase_add_test(tc, test_single_select);
292 tcase_add_test(tc, test_none_select); 260 tcase_add_test(tc, test_none_select);
293 tcase_add_test(tc, test_single_select_always);
294 tcase_add_test(tc, select_all_api); 261 tcase_add_test(tc, select_all_api);
295 tcase_add_test(tc, unselect_all_api); 262 tcase_add_test(tc, unselect_all_api);
296 tcase_add_test(tc, unselect_range); 263 tcase_add_test(tc, unselect_range);