summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2017-05-18 18:21:26 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2017-05-18 18:32:09 +0900
commit29410430e86bd253b444535d6be2fcd2ff57a3a2 (patch)
tree58bc36c882da29aec7679401be4590a7b762ef8e
parente58600b15388b26b6b01a405560d518956ae4535 (diff)
check: fix efl_ui_check_selected_set() API
send the theme signal after changing state. Thanks to JP for pointing out this. @fix Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
-rw-r--r--src/lib/elementary/elm_check.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/lib/elementary/elm_check.c b/src/lib/elementary/elm_check.c
index c6d9d9bb76..6aefe557be 100644
--- a/src/lib/elementary/elm_check.c
+++ b/src/lib/elementary/elm_check.c
@@ -335,9 +335,18 @@ _elm_check_selected_get(Eo *obj, Elm_Check_Data *pd EINA_UNUSED)
335} 335}
336 336
337EOLIAN static void 337EOLIAN static void
338_elm_check_selected_set(Eo *obj, Elm_Check_Data *pd EINA_UNUSED, Eina_Bool value) 338_elm_check_selected_set(Eo *obj, Elm_Check_Data *sd, Eina_Bool value)
339{ 339{
340 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
341
340 efl_ui_nstate_value_set(obj, value); 342 efl_ui_nstate_value_set(obj, value);
343 if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
344 if (efl_ui_nstate_value_get(obj) == 1)
345 elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
346 else if (efl_ui_nstate_value_get(obj) == 0)
347 elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
348
349 edje_object_message_signal_process(wd->resize_obj);
341} 350}
342 351
343EOLIAN static void 352EOLIAN static void
@@ -377,19 +386,7 @@ _elm_check_efl_object_constructor(Eo *obj, Elm_Check_Data *_pd EINA_UNUSED)
377EAPI void 386EAPI void
378elm_check_state_set(Evas_Object *obj, Eina_Bool state) 387elm_check_state_set(Evas_Object *obj, Eina_Bool state)
379{ 388{
380 ELM_CHECK_DATA_GET_OR_RETURN(obj, sd); 389 efl_ui_check_selected_set(obj, state);
381 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
382
383 if (state == efl_ui_nstate_value_get(obj)) return;
384
385 efl_ui_nstate_value_set(obj, state);
386 if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
387 if (efl_ui_nstate_value_get(obj) == 1)
388 elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
389 else if (efl_ui_nstate_value_get(obj) == 0)
390 elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
391
392 edje_object_message_signal_process(wd->resize_obj);
393} 390}
394 391
395EAPI Eina_Bool 392EAPI Eina_Bool