diff options
authorJinYong Park <j4939.park@samsung.com>2017-07-11 15:36:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-07-11 15:45:27 +0900
commit10d5f11a1450fd7b4295fbd0a99cc799eaeda4f6 (patch)
parentelm test: label slide - use better color as background for label. (diff)
popup: fix sizing eval logic when scrollable set TRUE
Summary: When scrollable set TRUE, scroller must be calculated its size except using item. If content is removed, scroller doesn't calculate its size, so it has previous size. So there is a empty space in this case. @fix Test Plan: 1. elementary_test -to popup 2. open "popup-center-title + list content + 2 button (with delete content)" 3. click "Delete" button 4. compare between scrollable set true and false Reviewers: herb, singh.amitesh, jpeg, cedric, conr2d Differential Revision: https://phab.enlightenment.org/D5010
2 files changed, 15 insertions, 4 deletions
diff --git a/src/bin/elementary/test_popup.c b/src/bin/elementary/test_popup.c
index 7de258836b..bfd17adefe 100644
--- a/src/bin/elementary/test_popup.c
+++ b/src/bin/elementary/test_popup.c
@@ -624,7 +624,13 @@ gl_popup_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EIN
static void
-_popup_center_title_list_content_1button_cb(void *data, Evas_Object *obj EINA_UNUSED,
+_delete_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+ elm_object_content_set(data, NULL);
+static void
+_popup_center_title_list_content_2button_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
Evas_Object *popup, *list;
@@ -648,6 +654,11 @@ _popup_center_title_list_content_1button_cb(void *data, Evas_Object *obj EINA_UN
elm_object_part_content_set(popup, "button1", btn);
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
+ btn = elm_button_add(popup);
+ elm_object_text_set(btn, "Delete");
+ elm_object_part_content_set(popup, "button2", btn);
+ evas_object_smart_callback_add(btn, "clicked", _delete_btn_clicked, popup);
// popup show should be called after adding all the contents and the buttons
// of popup to set the focus into popup's contents correctly.
@@ -885,8 +896,8 @@ test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_popup_transparent_cb, win);
elm_list_item_append(list, "popup-transparent-align", NULL, NULL,
_popup_transparent_align_cb, win);
- elm_list_item_append(list, "popup-center-title + list content + 1 button",
- NULL, NULL, _popup_center_title_list_content_1button_cb,
+ elm_list_item_append(list, "popup-center-title + list content + 2 button (with delete content)",
+ NULL, NULL, _popup_center_title_list_content_2button_cb,
elm_list_item_append(list, "popup-center-title + genlist content + 1 button",
NULL, NULL, _popup_center_title_genlist_content_1button_cb,
diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c
index 1cab8b7770..dc51f9749d 100644
--- a/src/lib/elementary/elc_popup.c
+++ b/src/lib/elementary/elc_popup.c
@@ -469,7 +469,7 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
efl_gfx_size_hint_combined_min_get(sd->scr, &minw, &minh);
evas_object_size_hint_max_get(sd->scr, &minw, &minh);
- else if (sd->scroll && (sd->content || sd->text_content_obj))
+ else if (sd->scroll)
double horizontal, vertical;
Evas_Coord w, h;