summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elc_ctxpopup.c
diff options
context:
space:
mode:
authorJinYong Park <j4939.park@samsung.com>2017-11-15 16:46:01 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-15 16:46:01 +0900
commitd96f3bb4f398590adeb95d05110cf95b757a429c (patch)
tree8548ec40bd1e12ae68f5732ee9be0bd735e76893 /src/lib/elementary/elc_ctxpopup.c
parent36afcf2af91d7ccec9144376f5550c5cf6a66579 (diff)
Ctxpopup: resizing ctxpopup after its content is removed
Summary: When ctxpopup's content is removed, ctxpopup doesn't recalculate its size, so empty space is remaind. To fix this problem, ctxpopup recalculate its size when content is removed. This patch is about T6327 @fix Test Plan: 1. run elementary_test -to ctxpopup 2. select 10st item 3. click button in ctxpopup Reviewers: jpeg, Jaehyun_Cho, zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5462
Diffstat (limited to 'src/lib/elementary/elc_ctxpopup.c')
-rw-r--r--src/lib/elementary/elc_ctxpopup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index bbe9132..717ca17 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -641,6 +641,19 @@ _parent_detach(Evas_Object *obj)
641} 641}
642 642
643static void 643static void
644_on_content_del(void *data,
645 Evas *e EINA_UNUSED,
646 Evas_Object *obj EINA_UNUSED,
647 void *event_info EINA_UNUSED)
648{
649 ELM_CTXPOPUP_DATA_GET(data, sd);
650
651 sd->content = NULL;
652 elm_box_recalculate(sd->box);
653 elm_layout_sizing_eval(data);
654}
655
656static void
644_on_content_resized(void *data, 657_on_content_resized(void *data,
645 Evas *e EINA_UNUSED, 658 Evas *e EINA_UNUSED,
646 Evas_Object *obj EINA_UNUSED, 659 Evas_Object *obj EINA_UNUSED,
@@ -709,6 +722,8 @@ _elm_ctxpopup_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part, Evas
709 sd->content = content; 722 sd->content = content;
710 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN; 723 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
711 724
725 evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _on_content_del, obj);
726
712 if (sd->visible) elm_layout_sizing_eval(obj); 727 if (sd->visible) elm_layout_sizing_eval(obj);
713 728
714 return EINA_TRUE; 729 return EINA_TRUE;
@@ -734,6 +749,8 @@ _elm_ctxpopup_content_unset(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
734 content = sd->content; 749 content = sd->content;
735 if (!content) return content; 750 if (!content) return content;
736 751
752 evas_object_event_callback_del(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
753
737 elm_box_unpack(sd->box, content); 754 elm_box_unpack(sd->box, content);
738 sd->content = NULL; 755 sd->content = NULL;
739 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN; 756 sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
@@ -1087,6 +1104,7 @@ _elm_ctxpopup_efl_canvas_group_group_del(Eo *obj, Elm_Ctxpopup_Data *sd)
1087 1104
1088 evas_object_event_callback_del_full 1105 evas_object_event_callback_del_full
1089 (sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj); 1106 (sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
1107 evas_object_event_callback_del(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
1090 _parent_detach(obj); 1108 _parent_detach(obj);
1091 1109
1092 elm_ctxpopup_clear(obj); 1110 elm_ctxpopup_clear(obj);