From 36ac3603d7343cc16efbc2edeb18cc59288a79f4 Mon Sep 17 00:00:00 2001 From: Mykyta Biliavskyi Date: Mon, 4 Aug 2014 19:46:03 +0900 Subject: [PATCH] ctxpopup: Fix wrong popup size. Summary: In case, when ctxpopup content have larger size than parent object, (by height, width or both) was resized popup at the full width or height of parent object size. @fix Reviewers: raster, seoz, cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D1266 --- legacy/elementary/src/lib/elc_ctxpopup.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/legacy/elementary/src/lib/elc_ctxpopup.c b/legacy/elementary/src/lib/elc_ctxpopup.c index 44d1884..fb19ca9 100644 --- a/legacy/elementary/src/lib/elc_ctxpopup.c +++ b/legacy/elementary/src/lib/elc_ctxpopup.c @@ -656,9 +656,20 @@ _elm_ctxpopup_elm_layout_sizing_eval(Eo *obj, Elm_Ctxpopup_Data *sd) if ((list_size.x >= rect.w) || (list_size.y >= rect.h)) { elm_list_mode_set(sd->list, ELM_LIST_COMPRESS); - evas_object_size_hint_min_set(sd->box, rect.w, rect.h); - evas_object_size_hint_min_set(obj, rect.w, rect.h); + evas_object_size_hint_min_set(obj, list_size.x, list_size.y); } + /* + Decrease height of main object initiate recalc of size (sizing_eval). + At each iteration of calculating size height of the object + will be closer to the height of the list. + */ + if (list_size.y < rect.h) rect.h--; + } + else if (sd->content) + { + evas_object_geometry_get(sd->content, 0, 0, &list_size.x, &list_size.y); + if ((list_size.x >= rect.w) || (list_size.y >= rect.h)) + evas_object_size_hint_min_set(obj, list_size.x, list_size.y); } evas_object_geometry_get(sd->parent, NULL, NULL, &parent_size.x, &parent_size.y); -- 2.7.4