diff options
author | Thiep Ha <thiepha@gmail.com> | 2017-08-17 07:56:23 +0900 |
---|---|---|
committer | Thiep Ha <thiepha@gmail.com> | 2017-08-17 07:56:23 +0900 |
commit | 5ab5d823fa34dc94b3c4a179c24bb624ecc8e686 (patch) | |
tree | e7a4e2c5500dbe33b689d367cc333cc188428a19 | |
parent | b3722c05f903f417467eb8d3559b633ce868fd8c (diff) | |
download | efl-5ab5d823fa34dc94b3c4a179c24bb624ecc8e686.tar.gz |
ui.box: Add handling for weight + align
Issue: If the item has weight and non-filled align, item is not resized.
This patch fixes this issue.
Test: elementary_test -> ui.box -> Equal weight. Buttons Btn1, BtnA, B, C
do not resize when resize the window.
ref T5487
-rw-r--r-- | src/lib/elementary/efl_ui_box_layout.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c index aa0e5e5c69..0fa88bcd0f 100644 --- a/src/lib/elementary/efl_ui_box_layout.c +++ b/src/lib/elementary/efl_ui_box_layout.c @@ -218,7 +218,10 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) } else { - w = item->want[0] - item->pad[0] - item->pad[1]; + if (horiz && item->weight[0] > 0) + w = cw - item->pad[0] - item->pad[1]; + else + w = item->want[0] - item->pad[0] - item->pad[1]; x = cx + ((cw - w) * item->align[0]) + item->pad[0]; } @@ -242,7 +245,10 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) } else { - h = item->want[1] - item->pad[2] - item->pad[3]; + if (!horiz && item->weight[1] > 0) + h = ch - item->pad[2] - item->pad[3]; + else + h = item->want[1] - item->pad[2] - item->pad[3]; y = cy + ((ch - h) * item->align[1]) + item->pad[2]; } |