forked from enlightenment/efl
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
This commit is contained in:
parent
79d3748557
commit
6d0f514126
|
@ -256,10 +256,7 @@ group { "efl/check";
|
|||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
signal: "mouse,clicked,1"; source: "event";
|
||||
action: SIGNAL_EMIT "efl,action,check,toggle" "efl";
|
||||
}
|
||||
EFL_UI_CLICKABLE_PART_BIND(event)
|
||||
program {
|
||||
signal: "efl,state,check,on"; source: "efl";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
|
@ -774,10 +771,7 @@ group { "efl/check:toggle";
|
|||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
signal: "mouse,clicked,1"; source: "event";
|
||||
action: SIGNAL_EMIT "efl,action,check,toggle" "efl";
|
||||
}
|
||||
EFL_UI_CLICKABLE_PART_BIND(event)
|
||||
program {
|
||||
signal: "efl,state,check,on"; source: "efl";
|
||||
script {
|
||||
|
|
|
@ -222,10 +222,7 @@ group { "efl/radio";
|
|||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
signal: "mouse,clicked,1"; source: "event";
|
||||
action: SIGNAL_EMIT "efl,action,radio,toggle" "efl";
|
||||
}
|
||||
EFL_UI_CLICKABLE_PART_BIND(event)
|
||||
program {
|
||||
signal: "efl,state,radio,on"; source: "efl";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
|
|
|
@ -253,6 +253,12 @@ _on_check_toggle(void *data,
|
|||
_activate(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
_activate(data);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_check_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *pd EINA_UNUSED)
|
||||
{
|
||||
|
@ -304,7 +310,7 @@ _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
|
|||
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
|
||||
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
||||
|
||||
efl_ui_clickable_util_bind_to_theme(wd->resize_obj, obj);
|
||||
if (elm_widget_is_legacy(obj))
|
||||
{
|
||||
efl_layout_signal_callback_add
|
||||
|
@ -320,8 +326,7 @@ _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED)
|
|||
(wd->resize_obj, "efl,action,check,on", "*", obj, _on_check_on, NULL);
|
||||
efl_layout_signal_callback_add
|
||||
(wd->resize_obj, "efl,action,check,off", "*", obj, _on_check_off, NULL);
|
||||
efl_layout_signal_callback_add
|
||||
(wd->resize_obj, "efl,action,check,toggle", "*", obj, _on_check_toggle, NULL);
|
||||
efl_event_callback_add(obj, EFL_INPUT_EVENT_CLICKED, _clicked_cb, obj);
|
||||
}
|
||||
|
||||
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_CHECK_BOX);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class @beta Efl.Ui.Check extends Efl.Ui.Layout_Base implements Efl.Access.Widget.Action, Efl.Text, Efl.Content
|
||||
class @beta Efl.Ui.Check extends Efl.Ui.Layout_Base implements Efl.Access.Widget.Action, Efl.Text, Efl.Content, Efl.Input.Clickable
|
||||
{
|
||||
[[Check widget
|
||||
|
||||
|
|
|
@ -218,12 +218,11 @@ _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd)
|
|||
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
||||
|
||||
/* in newer APIs the toggle is toggeled in check via the clickable interface */
|
||||
if (elm_widget_is_legacy(obj))
|
||||
elm_layout_signal_callback_add
|
||||
(obj, "elm,action,radio,toggle", "*", _radio_on_cb, obj);
|
||||
else
|
||||
elm_layout_signal_callback_add
|
||||
(obj, "efl,action,radio,toggle", "*", _radio_on_cb, obj);
|
||||
|
||||
|
||||
if (elm_widget_is_legacy(obj))
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "elm_widget.h"
|
||||
/* spec-meta-start
|
||||
{"test-interface":"Efl.Ui.Clickable",
|
||||
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized"]
|
||||
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized", "Efl.Ui.Radio", "Efl.Ui.Check"]
|
||||
}
|
||||
spec-meta-end
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue