efl_ui/layout: use min size hints when calculating layout size
authorMike Blumenkrantz <zmike@samsung.com>
Tue, 30 Jul 2019 17:11:24 +0000 (13:11 -0400)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 5 Aug 2019 01:48:36 +0000 (10:48 +0900)
Summary:
for legacy layouts, all min size hints should be considered when performing
size calculations

for non-legacy layouts, only "user" min size hints should be considered, as we
are calculating the restricted min size hint in this function

Depends on D9434

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9435

src/lib/elementary/efl_ui_layout.c

index 94bb517..883234b 100644 (file)
@@ -174,12 +174,25 @@ _part_cursor_free(Efl_Ui_Layout_Sub_Object_Cursor *pc)
 static void
 _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd)
 {
-   Evas_Coord minh = -1, minw = -1;
-   Evas_Coord rest_w = 0, rest_h = 0;
+   int minh = 0, minw = 0;
+   int rest_w = 0, rest_h = 0;
+   Eina_Size2D sz;
    ELM_WIDGET_DATA_GET_OR_RETURN(sd->obj, wd);
 
    if (!efl_alive_get(obj)) return;
 
+   if (elm_widget_is_legacy(obj))
+     sz = efl_gfx_hint_size_combined_min_get(obj);
+   else
+     sz = efl_gfx_hint_size_min_get(obj);
+   minw = sz.w;
+   minh = sz.h;
+
+   if (minw > rest_w)
+     rest_w = minw;
+   if (minh > rest_h)
+     rest_h = minh;
+
    if (sd->restricted_calc_w)
      rest_w = wd->w;
    if (sd->restricted_calc_h)