diff options
author | Kateryna Fesyna <k.fesyna@samsung.com> | 2014-10-31 15:16:09 +0900 |
---|---|---|
committer | ChunEon Park <hermet@hermet.pe.kr> | 2014-10-31 15:16:14 +0900 |
commit | 7bb9c022d1c4d01b14788a717037a72b4b34cab9 (patch) | |
tree | deec77f833628726536b426c05d270f548f40d44 /src/lib | |
parent | e01f11f51978eb36fa6abf506c032d07e8dfc2e3 (diff) |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/elm_panel.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 65e778a56..c8621b5fa 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c | |||
@@ -861,11 +861,17 @@ _elm_panel_elm_widget_event(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, Evas_Objec | |||
861 | EOLIAN static Eina_Bool | 861 | EOLIAN static Eina_Bool |
862 | _elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content) | 862 | _elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content) |
863 | { | 863 | { |
864 | if (part && strcmp(part, "default")) | 864 | if (part) |
865 | { | 865 | { |
866 | Eina_Bool int_ret = EINA_TRUE; | 866 | // "elm.swallow.event" part is used for internal needs and should not be changed. |
867 | eo_do_super(obj, MY_CLASS, int_ret = elm_obj_container_content_set(part, content)); | 867 | if (!strcmp(part, "elm.swallow.event")) return EINA_FALSE; |
868 | return int_ret; | 868 | if (strcmp(part, "default")) |
869 | { | ||
870 | Eina_Bool int_ret = EINA_TRUE; | ||
871 | eo_do_super(obj, MY_CLASS, | ||
872 | int_ret = elm_obj_container_content_set(part, content)); | ||
873 | return int_ret; | ||
874 | } | ||
869 | } | 875 | } |
870 | 876 | ||
871 | if (sd->content == content) return EINA_TRUE; | 877 | 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 | |||
886 | EOLIAN static Evas_Object* | 892 | EOLIAN static Evas_Object* |
887 | _elm_panel_elm_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part) | 893 | _elm_panel_elm_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part) |
888 | { | 894 | { |
889 | if (part && strcmp(part, "default")) | 895 | if (part) |
890 | { | 896 | { |
891 | Evas_Object *ret = NULL; | 897 | // "elm.swallow.event" part is used for internal needs and should not be changed. |
892 | eo_do_super(obj, MY_CLASS, ret = elm_obj_container_content_get(part)); | 898 | if (!strcmp(part, "elm.swallow.event")) return NULL; |
893 | return ret; | 899 | if (strcmp(part, "default")) |
900 | { | ||
901 | Evas_Object *ret = NULL; | ||
902 | eo_do_super(obj, MY_CLASS, ret = elm_obj_container_content_get(part)); | ||
903 | return ret; | ||
904 | } | ||
894 | } | 905 | } |
895 | 906 | ||
896 | return sd->content; | 907 | return sd->content; |
@@ -901,10 +912,16 @@ _elm_panel_elm_container_content_unset(Eo *obj, Elm_Panel_Data *sd, const char * | |||
901 | { | 912 | { |
902 | Evas_Object *ret = NULL; | 913 | Evas_Object *ret = NULL; |
903 | 914 | ||
904 | if (part && strcmp(part, "default")) | 915 | if (part) |
905 | { | 916 | { |
906 | eo_do_super(obj, MY_CLASS, ret = elm_obj_container_content_unset(part)); | 917 | // "elm.swallow.event" part is used for internal needs and should not be changed. |
907 | return ret; | 918 | if (!strcmp(part, "elm.swallow.event")) return NULL; |
919 | if (strcmp(part, "default")) | ||
920 | { | ||
921 | eo_do_super(obj, MY_CLASS, | ||
922 | ret = elm_obj_container_content_unset(part)); | ||
923 | return ret; | ||
924 | } | ||
908 | } | 925 | } |
909 | 926 | ||
910 | if (!sd->content) return NULL; | 927 | if (!sd->content) return NULL; |