efl_ui_spotlight_container: mirror the behavior of view_manager

setting the parent here is usefull, as we can forgot about this object
then, and do not have to free the object by hand.

Differential Revision: https://phab.enlightenment.org/D9305
This commit is contained in:
Marcel Hollerbach 2019-07-12 19:33:31 +02:00
parent 6d0b0baf9b
commit 2a970046bc
3 changed files with 6 additions and 2 deletions

View File

@ -347,7 +347,7 @@ indicator_icon_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Params *params = data;
params->indicator = efl_add(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS, params->spotlight);
params->indicator = efl_new(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS);
efl_ui_spotlight_indicator_set(params->spotlight, params->indicator);
}

View File

@ -637,6 +637,10 @@ _efl_ui_spotlight_container_indicator_set(Eo *obj, Efl_Ui_Spotlight_Container_Da
pd->indicator = indicator;
if (pd->indicator)
{
EINA_SAFETY_ON_FALSE_RETURN(efl_ownable_get(pd->indicator));
efl_parent_set(pd->indicator, obj);
//the api indicates that the caller passes ownership to this function, so we need to unref here
efl_unref(pd->indicator);
efl_ui_spotlight_indicator_bind(pd->indicator, obj);
if (pd->position != -1)
efl_ui_spotlight_indicator_position_update(pd->indicator, pd->position);

View File

@ -81,7 +81,7 @@ _create_indicator(void)
{
Eo *obj;
obj = efl_add(efl_ui_spotlight_indicator_realized_class_get(), win);
obj = efl_new(efl_ui_spotlight_indicator_realized_class_get());
efl_object_override(obj, &indicator_tracker);
return obj;