forked from enlightenment/efl
elm: add Elm.Layout as edje externals' contents instead of Edje.Object
Summary: When edje external parts add its content, edje object is added, but it breaks elementary widget hierarchy. In Elementary, edje external can use Elm.Layout to add its content. Reviewers: cedric Reviewed By: cedric Subscribers: woohyun Differential Revision: https://phab.enlightenment.org/D3655 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
2c2704c7f8
commit
895ed5bde3
|
@ -270,8 +270,8 @@ external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj,
|
|||
}
|
||||
|
||||
Evas_Object *
|
||||
external_common_param_edje_object_get(Evas_Object *obj,
|
||||
const Edje_External_Param *p)
|
||||
external_common_param_elm_layout_get(Evas_Object *obj,
|
||||
const Edje_External_Param *p)
|
||||
{
|
||||
Evas_Object *edje, *parent_widget, *ret;
|
||||
const char *file;
|
||||
|
@ -283,14 +283,18 @@ external_common_param_edje_object_get(Evas_Object *obj,
|
|||
edje_object_file_get(edje, &file, NULL);
|
||||
|
||||
parent_widget = elm_widget_parent_widget_get(obj);
|
||||
if (!parent_widget)
|
||||
parent_widget = edje;
|
||||
|
||||
ret = edje_object_add(evas_object_evas_get(parent_widget));
|
||||
|
||||
if (edje_object_file_set(ret, file, p->s))
|
||||
return ret;
|
||||
|
||||
if (parent_widget)
|
||||
{
|
||||
ret = elm_layout_add(parent_widget);
|
||||
if (elm_layout_file_set(ret, file, p->s))
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = edje_object_add(evas_object_evas_get(edje));
|
||||
if (edje_object_file_set(ret, file, p->s))
|
||||
return ret;
|
||||
}
|
||||
evas_object_del(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ external_bubble_param_set(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
|
||||
{
|
||||
Evas_Object *content = \
|
||||
external_common_param_edje_object_get(obj, param);
|
||||
external_common_param_elm_layout_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
|
||||
elm_object_content_set(obj, content);
|
||||
return EINA_TRUE;
|
||||
|
@ -131,7 +131,7 @@ external_bubble_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
if (!strcmp(param->name, "info"))
|
||||
mem->info = eina_stringshare_add(param->s);
|
||||
else if (!strcmp(param->name, "content"))
|
||||
mem->content = external_common_param_edje_object_get(obj, param);
|
||||
mem->content = external_common_param_elm_layout_get(obj, param);
|
||||
else if (!strcmp(param->name, "label"))
|
||||
mem->label = eina_stringshare_add(param->s);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ external_frame_param_set(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
|
||||
{
|
||||
Evas_Object *content =
|
||||
external_common_param_edje_object_get(obj,param);
|
||||
external_common_param_elm_layout_get(obj,param);
|
||||
if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
|
||||
elm_object_content_set(obj, content);
|
||||
return EINA_TRUE;
|
||||
|
@ -91,7 +91,7 @@ external_frame_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
EINA_LIST_FOREACH(params, l, param)
|
||||
{
|
||||
if (!strcmp(param->name, "content"))
|
||||
mem->content = external_common_param_edje_object_get(obj, param);
|
||||
mem->content = external_common_param_elm_layout_get(obj, param);
|
||||
else if (!strcmp(param->name, "label"))
|
||||
mem->label = eina_stringshare_add(param->s);
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ external_notify_param_set(void *data EINA_UNUSED,
|
|||
&& (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
|
||||
{
|
||||
Evas_Object *content =
|
||||
external_common_param_edje_object_get(obj, param);
|
||||
external_common_param_elm_layout_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!content))
|
||||
return EINA_FALSE;
|
||||
elm_object_content_set(obj, content);
|
||||
|
@ -247,7 +247,7 @@ external_notify_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
EINA_LIST_FOREACH(params, l, param)
|
||||
{
|
||||
if (!strcmp(param->name, "content"))
|
||||
mem->content = external_common_param_edje_object_get(obj, param);
|
||||
mem->content = external_common_param_elm_layout_get(obj, param);
|
||||
else if (!strcmp(param->name, "timeout"))
|
||||
{
|
||||
mem->timeout = param->d;
|
||||
|
|
|
@ -47,7 +47,7 @@ static Eina_Bool external_panes_param_set(void *data EINA_UNUSED,
|
|||
if ((!strcmp(param->name, "content left"))
|
||||
&& (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
|
||||
{
|
||||
Evas_Object *content = external_common_param_edje_object_get(obj, param);
|
||||
Evas_Object *content = external_common_param_elm_layout_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!content))
|
||||
return EINA_FALSE;
|
||||
elm_object_part_content_set(obj, "left", content);
|
||||
|
@ -56,7 +56,7 @@ static Eina_Bool external_panes_param_set(void *data EINA_UNUSED,
|
|||
else if ((!strcmp(param->name, "content right"))
|
||||
&& (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
|
||||
{
|
||||
Evas_Object *content = external_common_param_edje_object_get(obj, param);
|
||||
Evas_Object *content = external_common_param_elm_layout_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!content))
|
||||
return EINA_FALSE;
|
||||
elm_object_part_content_set(obj, "right", content);
|
||||
|
@ -141,9 +141,9 @@ external_panes_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
EINA_LIST_FOREACH(params, l, param)
|
||||
{
|
||||
if (!strcmp(param->name, "content left"))
|
||||
mem->content_left = external_common_param_edje_object_get(obj, param);
|
||||
mem->content_left = external_common_param_elm_layout_get(obj, param);
|
||||
else if (!strcmp(param->name, "content right"))
|
||||
mem->content_right = external_common_param_edje_object_get(obj, param);
|
||||
mem->content_right = external_common_param_elm_layout_get(obj, param);
|
||||
else if (!strcmp(param->name, "horizontal"))
|
||||
{
|
||||
mem->is_horizontal = EINA_TRUE;
|
||||
|
|
|
@ -32,7 +32,7 @@ static Eina_Bool external_scroller_param_set(void *data EINA_UNUSED,
|
|||
if (!strcmp(param->name, "content")
|
||||
&& param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
|
||||
{
|
||||
Evas_Object *content = external_common_param_edje_object_get(obj, param);
|
||||
Evas_Object *content = external_common_param_elm_layout_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!content))
|
||||
return EINA_FALSE;
|
||||
elm_object_content_set(obj, content);
|
||||
|
@ -76,7 +76,7 @@ static void * external_scroller_params_parse(void *data EINA_UNUSED,
|
|||
EINA_LIST_FOREACH(params, l, param)
|
||||
{
|
||||
if (!strcmp(param->name, "content"))
|
||||
mem->content = external_common_param_edje_object_get(obj, param);
|
||||
mem->content = external_common_param_elm_layout_get(obj, param);
|
||||
}
|
||||
|
||||
return mem;
|
||||
|
|
|
@ -31,7 +31,7 @@ const char *external_translate(void *data, const char *orig);
|
|||
void external_common_params_free(void *params);
|
||||
void *external_common_params_parse_internal(size_t params_size, void *data, Evas_Object *obj, const Eina_List *params);
|
||||
Evas_Object *external_common_param_icon_get(Evas_Object *obj, const Edje_External_Param *param);
|
||||
Evas_Object *external_common_param_edje_object_get(Evas_Object *obj, const Edje_External_Param *p);
|
||||
Evas_Object *external_common_param_elm_layout_get(Evas_Object *obj, const Edje_External_Param *p);
|
||||
void external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj, const Eina_List *params);
|
||||
Eina_Bool external_common_param_get(void *data, const Evas_Object *obj, Edje_External_Param *param);
|
||||
Eina_Bool external_common_param_set(void *data, Evas_Object *obj, const Edje_External_Param *param);
|
||||
|
|
Loading…
Reference in New Issue