Summary:
Fix children size and position calculation when padding is used
For each child size calculation padding is adjusted
but box height should include padding.
Secondly, x and y position of children should not include
the vertical and horizonatal padding as child size has already
included the given paddings.
@fix
Test Plan:
Please modify test_box.c file in
function test_box_vert2 as follows:
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
elm_box_padding_set(bx, 50, 50);
elm_box_layout_set(bx, evas_object_box_layout_flow_horizontal, NULL, NULL);
evas_object_show(bx);
Now,
1. open elementary_test
2. box
3. Box vert 2 (observe box is broken)
4. Try resizing the window (observe)
Reviewers: raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3049
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
(priv, w, &row_count, row_max_h, row_break, row_width, &offset_y, &min_w, &max_h);
inc_y = 0;
- remain_y = h - (offset_y + max_h);
+ remain_y = h - (priv->pad.v * row_count -1) - (offset_y + max_h);
if (remain_y > 0)
{
int row_size, remain_x;
row_size = row_break[r] - i;
- remain_x = (w - row_width[r]);
+ remain_x = (w - (row_width[r] - priv->pad.h));
if (priv->align.h < 0.0)
{
evas_object_geometry_get(o, &x, NULL, NULL, NULL);
min_h += row_max_h[r];
y += row_max_h[r] + inc_y;
+
+ if (r > 0)
+ min_h += priv->pad.v;
}
evas_object_size_hint_min_set(o, min_w, min_h);