summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongJong Lee <yj34.lee@samsung.com>2018-06-04 17:48:06 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-06-04 17:48:06 +0900
commit1b245787fe1fc5da41b6ed77dd67cb022900afa6 (patch)
treee0a01376292ff8a5fd285828b062fc17c9b1e927
parentdbb464e94e3b6a6d7557f2b2228e2be587d139d2 (diff)
downloadefl-1b245787fe1fc5da41b6ed77dd67cb022900afa6.tar.gz
elementary: fix wrong signal emission
Summary: When _icon_signal_emit is called, "icon" part always exist. so, it only make "visible" signal. this fixes that issue Test Plan: elm_object_content_unset(button); elm_object_content_unset(radio); elm_object_content_unset(check); elm_object_content_unset(progressbar); Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6241
-rw-r--r--src/lib/elementary/efl_ui_button.c12
-rw-r--r--src/lib/elementary/efl_ui_check.c12
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c12
-rw-r--r--src/lib/elementary/efl_ui_radio.c12
4 files changed, 24 insertions, 24 deletions
diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c
index 7081d8c915..a84ba81dad 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -425,13 +425,12 @@ _efl_ui_button_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
static void
-_icon_signal_emit(Evas_Object *obj)
+_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
{
char buf[64];
if (!elm_widget_resize_object_get(obj)) return;
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
elm_layout_signal_emit(obj, buf, "elm");
edje_object_message_signal_process(elm_layout_edje_get(obj));
@@ -448,7 +447,7 @@ _efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, !!elm_layout_content_get(obj, "icon"));
return int_ret;
}
@@ -464,7 +463,7 @@ _efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EIN
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), sobj);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, EINA_FALSE);
return EINA_TRUE;
}
@@ -480,7 +479,8 @@ _efl_ui_button_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *pa
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ if (content)
+ _icon_signal_emit(obj, EINA_TRUE);
return EINA_TRUE;
}
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index bf6e8c2aa8..bf536bf93c 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -479,14 +479,13 @@ _efl_ui_check_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
static void
-_icon_signal_emit(Evas_Object *obj)
+_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
char buf[64];
if (!elm_widget_resize_object_get(obj)) return;
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
elm_layout_signal_emit(obj, buf, "elm");
edje_object_message_signal_process(wd->resize_obj);
@@ -505,7 +504,7 @@ _efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, !!elm_layout_content_get(obj, "icon"));
return int_ret;
}
@@ -521,7 +520,7 @@ _efl_ui_check_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), sobj);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, EINA_FALSE);
return EINA_TRUE;
}
@@ -537,7 +536,8 @@ _efl_ui_check_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *par
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ if (content)
+ _icon_signal_emit(obj, EINA_TRUE);
return EINA_TRUE;
}
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index c1a3f1a998..a1a220c53a 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -800,13 +800,12 @@ _efl_ui_progressbar_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
static void
-_icon_signal_emit(Evas_Object *obj)
+_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
{
char buf[64];
if (!elm_widget_resize_object_get(obj)) return;
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
elm_layout_signal_emit(obj, buf, "elm");
edje_object_message_signal_process(elm_layout_edje_get(obj));
@@ -823,7 +822,7 @@ _efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNU
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, !!elm_layout_content_get(obj, "icon"));
return int_ret;
}
@@ -839,7 +838,7 @@ _efl_ui_progressbar_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_p
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), sobj);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, EINA_FALSE);
return EINA_TRUE;
}
@@ -855,7 +854,8 @@ _efl_ui_progressbar_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const cha
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ if (content)
+ _icon_signal_emit(obj, EINA_TRUE);
return EINA_TRUE;
}
diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c
index 16ef832d1e..fbd7f25ce9 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -398,15 +398,14 @@ _efl_ui_radio_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
static void
-_icon_signal_emit(Evas_Object *obj)
+_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
{
char buf[63];
Eo *edje;
edje = elm_widget_resize_object_get(obj);
if (!edje) return;
- snprintf(buf, sizeof(buf), "elm,state,icon,%s",
- elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
+ snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
elm_layout_signal_emit(obj, buf, "elm");
edje_object_message_signal_process(edje);
@@ -423,7 +422,7 @@ _efl_ui_radio_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
/* FIXME: replicated from elm_layout just because radio's icon
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
* whenever we can changed the theme API */
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, !!elm_layout_content_get(obj, "icon"));
return int_ret;
}
@@ -439,7 +438,7 @@ _efl_ui_radio_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS), sobj);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ _icon_signal_emit(obj, EINA_FALSE);
return EINA_TRUE;
}
@@ -455,7 +454,8 @@ _efl_ui_radio_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *par
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
- _icon_signal_emit(obj);
+ if (content)
+ _icon_signal_emit(obj, EINA_TRUE);
return EINA_TRUE;
}