forked from enlightenment/efl
Efl.Ui.Nstate: do not call "changed" callback
Before solving following problem in Efl.Ui.Check https://phab.enlightenment.org/T6673 The changed callback is called with opposite value, if application is using Efl.Ui.Check with state pointer. The reason is that the changed callback is called in efl_ui_nstate_activate, and the value refered by state pointer is changed only after the efl_ui_nstate_activate is called. static void _activate(Evas_Object *obj) { EFL_UI_CHECK_DATA_GET(obj, sd); efl_ui_nstate_activate(obj); if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
This commit is contained in:
parent
d8aa950a38
commit
fd8e9f9c4e
|
@ -75,6 +75,8 @@ _activate(Evas_Object *obj)
|
||||||
_elm_access_say(E_("State: Off"));
|
_elm_access_say(E_("State: Off"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
efl_event_callback_legacy_call(obj, EFL_UI_CHECK_EVENT_CHANGED, NULL);
|
||||||
|
|
||||||
if (_elm_config->atspi_mode)
|
if (_elm_config->atspi_mode)
|
||||||
efl_access_state_changed_signal_emit(obj,
|
efl_access_state_changed_signal_emit(obj,
|
||||||
EFL_ACCESS_STATE_CHECKED,
|
EFL_ACCESS_STATE_CHECKED,
|
||||||
|
|
|
@ -63,18 +63,6 @@ _next_state_set(Efl_Ui_Nstate_Data *sd)
|
||||||
if (sd->state == sd->nstate) sd->state = 0;
|
if (sd->state == sd->nstate) sd->state = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_state_active(Evas_Object *obj, Efl_Ui_Nstate_Data *sd)
|
|
||||||
{
|
|
||||||
char buf[64];
|
|
||||||
|
|
||||||
sprintf(buf, "elm,state,changed,%d", sd->state);
|
|
||||||
elm_layout_signal_emit(obj, buf, "elm");
|
|
||||||
edje_object_message_signal_process(elm_layout_edje_get(obj));
|
|
||||||
elm_layout_sizing_eval(obj);
|
|
||||||
efl_event_callback_legacy_call(obj, EFL_UI_NSTATE_EVENT_CHANGED, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static int
|
EOLIAN static int
|
||||||
_efl_ui_nstate_count_get(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
|
_efl_ui_nstate_count_get(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
|
||||||
{
|
{
|
||||||
|
@ -106,12 +94,11 @@ _is_valid_state(Efl_Ui_Nstate_Data *sd, int state)
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Nstate_Data *pd, int state)
|
_efl_ui_nstate_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd, int state)
|
||||||
{
|
{
|
||||||
if (!_is_valid_state(pd, state)) return;
|
if (!_is_valid_state(pd, state)) return;
|
||||||
|
|
||||||
pd->state = state;
|
pd->state = state;
|
||||||
_state_active(obj, pd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Ui_Theme_Apply
|
EOLIAN static Efl_Ui_Theme_Apply
|
||||||
|
@ -133,10 +120,9 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_nstate_activate(Eo *obj, Efl_Ui_Nstate_Data *_pd)
|
_efl_ui_nstate_activate(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *_pd)
|
||||||
{
|
{
|
||||||
_next_state_set(_pd);
|
_next_state_set(_pd);
|
||||||
_state_active(obj, _pd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
|
|
Loading…
Reference in New Issue