summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_ui_radio.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-22 15:06:22 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-29 08:29:58 +0200
commitd445e5240b03ddf659b3c16c74d982956a2a7b67 (patch)
tree783ad8be965445c207fb6a6757d303409faf3ebb /src/bin/elementary/test_ui_radio.c
parentc6e338bb9ad392f074e1dd3704d2e36cc26fcab3 (diff)
efl_ui_radio_group: migrate to Efl.Ui.Single_Selectable
with this the whole thing is migrated to single_selectable. The group is added to the spec test suite. The elm_test case of radio_group now also has a fallback option to demonstrate the usage of it. This also fixes a broken testcase, where a flag was forgotten to be checked. ref T8024 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9706
Diffstat (limited to '')
-rw-r--r--src/bin/elementary/test_ui_radio.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/bin/elementary/test_ui_radio.c b/src/bin/elementary/test_ui_radio.c
index ec2740f..487c6aa 100644
--- a/src/bin/elementary/test_ui_radio.c
+++ b/src/bin/elementary/test_ui_radio.c
@@ -77,12 +77,12 @@ _set_selected_btn_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
77} 77}
78 78
79static void 79static void
80_set_selected_object_btn_clicked(void *data, const Efl_Event *ev) 80_set_fallback_radio_btn_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
81{ 81{
82 Efl_Ui_Radio_Group *group = data; 82 if (!efl_ui_single_selectable_fallback_selection_get(data))
83 83 efl_ui_single_selectable_fallback_selection_set(data, efl_pack_content_get(data, 4));
84 efl_ui_radio_group_selected_value_set(group, 3); 84 else
85 efl_ui_radio_group_selected_object_set(group, efl_key_data_get(ev->object, "uk")); 85 efl_ui_single_selectable_fallback_selection_set(data, NULL);
86} 86}
87 87
88void test_efl_ui_radio(void *data EINA_UNUSED, 88void test_efl_ui_radio(void *data EINA_UNUSED,
@@ -94,7 +94,6 @@ void test_efl_ui_radio(void *data EINA_UNUSED,
94 Efl_Ui_Box *bx; 94 Efl_Ui_Box *bx;
95 Eina_Array *arr; 95 Eina_Array *arr;
96 Efl_Ui_Button *o; 96 Efl_Ui_Button *o;
97 Efl_Ui_Radio *uk = NULL;
98 97
99 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), 98 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
100 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), 99 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
@@ -112,8 +111,6 @@ void test_efl_ui_radio(void *data EINA_UNUSED,
112 { 111 {
113 Efl_Ui_Radio *r = eina_array_data_get(arr, i); 112 Efl_Ui_Radio *r = eina_array_data_get(arr, i);
114 efl_pack_end(bx, r); 113 efl_pack_end(bx, r);
115 if (i == 4)
116 uk = r;
117 } 114 }
118 115
119 o = efl_add(EFL_UI_BUTTON_CLASS, table); 116 o = efl_add(EFL_UI_BUTTON_CLASS, table);
@@ -128,9 +125,8 @@ void test_efl_ui_radio(void *data EINA_UNUSED,
128 125
129 o = efl_add(EFL_UI_BUTTON_CLASS, table); 126 o = efl_add(EFL_UI_BUTTON_CLASS, table);
130 efl_pack_table(table, o, 1, 2, 1, 1); 127 efl_pack_table(table, o, 1, 2, 1, 1);
131 efl_text_set(o, "Set object for UK"); 128 efl_text_set(o, "Fallback set to UK");
132 efl_key_data_set(o, "uk", uk); 129 efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _set_fallback_radio_btn_clicked, bx);
133 efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _set_selected_object_btn_clicked, bx);
134 130
135 eina_array_free(arr); 131 eina_array_free(arr);
136} 132}