summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-31 09:02:05 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-07-31 09:12:07 -0400
commit6d0f51412626b13e495a3eed559880b1266403f7 (patch)
tree722c06500dbbf6a4da62f8c7b081d55eeeb4108d /src/lib
parent79d3748557e23cdd0edbe7a917d7038ec590cd59 (diff)
efl_ui_check/radio: use clickable
Summary: with this commit the state of the check / radio buttons are changes when the Widget is clicked. The Widget is now using clickable and emits all the events. ref T7865 Reviewers: segfaultxavi, zmike, Jaehyun_Cho, woohyun Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7865 Differential Revision: https://phab.enlightenment.org/D9456
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/efl_ui_check.c11
-rw-r--r--src/lib/elementary/efl_ui_check.eo2
-rw-r--r--src/lib/elementary/efl_ui_radio.c5
3 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index 3492c360ee..87bc965a36 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -253,6 +253,12 @@ _on_check_toggle(void *data,
253 _activate(data); 253 _activate(data);
254} 254}
255 255
256static void
257_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
258{
259 _activate(data);
260}
261
256EOLIAN static Eina_Bool 262EOLIAN static Eina_Bool
257_efl_ui_check_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *pd EINA_UNUSED) 263_efl_ui_check_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *pd EINA_UNUSED)
258{ 264{
@@ -304,7 +310,7 @@ _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
304 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 310 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
305 311
306 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 312 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
307 313 efl_ui_clickable_util_bind_to_theme(wd->resize_obj, obj);
308 if (elm_widget_is_legacy(obj)) 314 if (elm_widget_is_legacy(obj))
309 { 315 {
310 efl_layout_signal_callback_add 316 efl_layout_signal_callback_add
@@ -320,8 +326,7 @@ _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
320 (wd->resize_obj, "efl,action,check,on", "*", obj, _on_check_on, NULL); 326 (wd->resize_obj, "efl,action,check,on", "*", obj, _on_check_on, NULL);
321 efl_layout_signal_callback_add 327 efl_layout_signal_callback_add
322 (wd->resize_obj, "efl,action,check,off", "*", obj, _on_check_off, NULL); 328 (wd->resize_obj, "efl,action,check,off", "*", obj, _on_check_off, NULL);
323 efl_layout_signal_callback_add 329 efl_event_callback_add(obj, EFL_INPUT_EVENT_CLICKED, _clicked_cb, obj);
324 (wd->resize_obj, "efl,action,check,toggle", "*", obj, _on_check_toggle, NULL);
325 } 330 }
326 331
327 efl_access_object_role_set(obj, EFL_ACCESS_ROLE_CHECK_BOX); 332 efl_access_object_role_set(obj, EFL_ACCESS_ROLE_CHECK_BOX);
diff --git a/src/lib/elementary/efl_ui_check.eo b/src/lib/elementary/efl_ui_check.eo
index 95d1635054..b1571ca203 100644
--- a/src/lib/elementary/efl_ui_check.eo
+++ b/src/lib/elementary/efl_ui_check.eo
@@ -1,4 +1,4 @@
1class @beta Efl.Ui.Check extends Efl.Ui.Layout_Base implements Efl.Access.Widget.Action, Efl.Text, Efl.Content 1class @beta Efl.Ui.Check extends Efl.Ui.Layout_Base implements Efl.Access.Widget.Action, Efl.Text, Efl.Content, Efl.Input.Clickable
2{ 2{
3 [[Check widget 3 [[Check widget
4 4
diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c
index 581a5c6319..5458db7f5b 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -218,12 +218,11 @@ _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd)
218 218
219 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 219 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
220 220
221 /* in newer APIs the toggle is toggeled in check via the clickable interface */
221 if (elm_widget_is_legacy(obj)) 222 if (elm_widget_is_legacy(obj))
222 elm_layout_signal_callback_add 223 elm_layout_signal_callback_add
223 (obj, "elm,action,radio,toggle", "*", _radio_on_cb, obj); 224 (obj, "elm,action,radio,toggle", "*", _radio_on_cb, obj);
224 else 225
225 elm_layout_signal_callback_add
226 (obj, "efl,action,radio,toggle", "*", _radio_on_cb, obj);
227 226
228 if (elm_widget_is_legacy(obj)) 227 if (elm_widget_is_legacy(obj))
229 { 228 {