forked from enlightenment/efl
Elm_Panel: forbid changing of content of "elm.swallow.event" part
Summary: Because the "elm.swallow.event" part is used for internal needs of Panel widget setting up or unsetting content of this part can break the behavior of this widget. Due to the fact that this part is invisible and does not have any use cases for user it seems acceptable to forbid changing of its content. @fix Reviewers: cedric, seoz, raster, Hermet Reviewed By: Hermet Subscribers: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D1587
This commit is contained in:
parent
b94db6c8f8
commit
69c9b0ecde
|
@ -861,11 +861,17 @@ _elm_panel_elm_widget_event(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, Evas_Objec
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
_elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content)
|
_elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content)
|
||||||
{
|
{
|
||||||
if (part && strcmp(part, "default"))
|
if (part)
|
||||||
{
|
{
|
||||||
Eina_Bool int_ret = EINA_TRUE;
|
// "elm.swallow.event" part is used for internal needs and should not be changed.
|
||||||
eo_do_super(obj, MY_CLASS, int_ret = elm_obj_container_content_set(part, content));
|
if (!strcmp(part, "elm.swallow.event")) return EINA_FALSE;
|
||||||
return int_ret;
|
if (strcmp(part, "default"))
|
||||||
|
{
|
||||||
|
Eina_Bool int_ret = EINA_TRUE;
|
||||||
|
eo_do_super(obj, MY_CLASS,
|
||||||
|
int_ret = elm_obj_container_content_set(part, content));
|
||||||
|
return int_ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sd->content == content) return EINA_TRUE;
|
if (sd->content == content) return EINA_TRUE;
|
||||||
|
@ -886,11 +892,16 @@ _elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *pa
|
||||||
EOLIAN static Evas_Object*
|
EOLIAN static Evas_Object*
|
||||||
_elm_panel_elm_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
|
_elm_panel_elm_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
|
||||||
{
|
{
|
||||||
if (part && strcmp(part, "default"))
|
if (part)
|
||||||
{
|
{
|
||||||
Evas_Object *ret = NULL;
|
// "elm.swallow.event" part is used for internal needs and should not be changed.
|
||||||
eo_do_super(obj, MY_CLASS, ret = elm_obj_container_content_get(part));
|
if (!strcmp(part, "elm.swallow.event")) return NULL;
|
||||||
return ret;
|
if (strcmp(part, "default"))
|
||||||
|
{
|
||||||
|
Evas_Object *ret = NULL;
|
||||||
|
eo_do_super(obj, MY_CLASS, ret = elm_obj_container_content_get(part));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sd->content;
|
return sd->content;
|
||||||
|
@ -901,10 +912,16 @@ _elm_panel_elm_container_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *
|
||||||
{
|
{
|
||||||
Evas_Object *ret = NULL;
|
Evas_Object *ret = NULL;
|
||||||
|
|
||||||
if (part && strcmp(part, "default"))
|
if (part)
|
||||||
{
|
{
|
||||||
eo_do_super(obj, MY_CLASS, ret = elm_obj_container_content_unset(part));
|
// "elm.swallow.event" part is used for internal needs and should not be changed.
|
||||||
return ret;
|
if (!strcmp(part, "elm.swallow.event")) return NULL;
|
||||||
|
if (strcmp(part, "default"))
|
||||||
|
{
|
||||||
|
eo_do_super(obj, MY_CLASS,
|
||||||
|
ret = elm_obj_container_content_unset(part));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sd->content) return NULL;
|
if (!sd->content) return NULL;
|
||||||
|
|
Loading…
Reference in New Issue