forked from enlightenment/efl
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
This commit is contained in:
parent
dbb464e94e
commit
1b245787fe
|
@ -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
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||||
* can changed the theme API */
|
* can changed the theme API */
|
||||||
static void
|
static void
|
||||||
_icon_signal_emit(Evas_Object *obj)
|
_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (!elm_widget_resize_object_get(obj)) return;
|
if (!elm_widget_resize_object_get(obj)) return;
|
||||||
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
|
||||||
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
|
||||||
|
|
||||||
elm_layout_signal_emit(obj, buf, "elm");
|
elm_layout_signal_emit(obj, buf, "elm");
|
||||||
edje_object_message_signal_process(elm_layout_edje_get(obj));
|
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));
|
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS));
|
||||||
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
|
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;
|
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);
|
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), sobj);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
_icon_signal_emit(obj, EINA_FALSE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
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);
|
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), part), content);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
if (content)
|
||||||
|
_icon_signal_emit(obj, EINA_TRUE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||||
* can changed the theme API */
|
* can changed the theme API */
|
||||||
static void
|
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);
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (!elm_widget_resize_object_get(obj)) return;
|
if (!elm_widget_resize_object_get(obj)) return;
|
||||||
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
|
||||||
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
|
||||||
|
|
||||||
elm_layout_signal_emit(obj, buf, "elm");
|
elm_layout_signal_emit(obj, buf, "elm");
|
||||||
edje_object_message_signal_process(wd->resize_obj);
|
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));
|
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS));
|
||||||
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
|
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;
|
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);
|
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), sobj);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
_icon_signal_emit(obj, EINA_FALSE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
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);
|
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), part), content);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
if (content)
|
||||||
|
_icon_signal_emit(obj, EINA_TRUE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||||
* can changed the theme API */
|
* can changed the theme API */
|
||||||
static void
|
static void
|
||||||
_icon_signal_emit(Evas_Object *obj)
|
_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (!elm_widget_resize_object_get(obj)) return;
|
if (!elm_widget_resize_object_get(obj)) return;
|
||||||
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
|
||||||
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
|
||||||
|
|
||||||
elm_layout_signal_emit(obj, buf, "elm");
|
elm_layout_signal_emit(obj, buf, "elm");
|
||||||
edje_object_message_signal_process(elm_layout_edje_get(obj));
|
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));
|
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS));
|
||||||
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
|
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;
|
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);
|
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), sobj);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
_icon_signal_emit(obj, EINA_FALSE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
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);
|
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), part), content);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
if (content)
|
||||||
|
_icon_signal_emit(obj, EINA_TRUE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||||
* can changed the theme API */
|
* can changed the theme API */
|
||||||
static void
|
static void
|
||||||
_icon_signal_emit(Evas_Object *obj)
|
_icon_signal_emit(Evas_Object *obj, Eina_Bool vis)
|
||||||
{
|
{
|
||||||
char buf[63];
|
char buf[63];
|
||||||
Eo *edje;
|
Eo *edje;
|
||||||
|
|
||||||
edje = elm_widget_resize_object_get(obj);
|
edje = elm_widget_resize_object_get(obj);
|
||||||
if (!edje) return;
|
if (!edje) return;
|
||||||
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
snprintf(buf, sizeof(buf), "elm,state,icon,%s", vis ? "visible" : "hidden");
|
||||||
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
|
||||||
|
|
||||||
elm_layout_signal_emit(obj, buf, "elm");
|
elm_layout_signal_emit(obj, buf, "elm");
|
||||||
edje_object_message_signal_process(edje);
|
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
|
/* FIXME: replicated from elm_layout just because radio's icon
|
||||||
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
|
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
|
||||||
* whenever we can changed the theme API */
|
* whenever we can changed the theme API */
|
||||||
_icon_signal_emit(obj);
|
_icon_signal_emit(obj, !!elm_layout_content_get(obj, "icon"));
|
||||||
|
|
||||||
return int_ret;
|
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);
|
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS), sobj);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
_icon_signal_emit(obj, EINA_FALSE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
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);
|
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS), part), content);
|
||||||
if (!int_ret) return EINA_FALSE;
|
if (!int_ret) return EINA_FALSE;
|
||||||
|
|
||||||
_icon_signal_emit(obj);
|
if (content)
|
||||||
|
_icon_signal_emit(obj, EINA_TRUE);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue