thiep pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5ab5d823fa34dc94b3c4a179c24bb624ecc8e686

commit 5ab5d823fa34dc94b3c4a179c24bb624ecc8e686
Author: Thiep Ha <thie...@gmail.com>
Date:   Thu Aug 17 07:56:23 2017 +0900

    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
---
 src/lib/elementary/efl_ui_box_layout.c | 10 ++++++++--
 1 file 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];
           }
 

-- 


Reply via email to