Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_box.c 


Log Message:
Fix the allocation of excess and insufficient space so that it doesn't
overflow it's container when not necessary.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_box.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_box.c   28 Mar 2005 07:04:27 -0000      1.3
+++ ewl_box.c   22 May 2005 06:27:33 -0000      1.4
@@ -457,18 +457,20 @@
                 * alignment. First check for top/left alignment.
                 */
                if (VISIBLE(child)) {
+                       unsigned int policy;
 
                        /*
                         * Set the initial fill size to the preferred size.
                         */
                        ewl_box_info->fill_set(child, initial);
 
+                       change = ewl_box_info->fill_ask(child);
+
                        /*
                         * Figure out how much extra space is available for
                         * filling widgets.
                         */
-                       change = *fill_size;
-                       *fill_size -= ewl_box_info->fill_ask(child) + 
b->spacing;
+                       *fill_size -= change + b->spacing;
 
                        /*
                         * Attempt to give the widget the full size, this will
@@ -480,7 +482,9 @@
                         * If it has a fill policy for a direction we're
                         * concerned with, add it to the fill list.
                         */
-                       if (ewl_object_fill_policy_get(child) & 
ewl_box_info->f_policy)
+                       policy = ewl_object_fill_policy_get(child);
+                       policy &= ewl_box_info->f_policy;
+                       if (policy || change == initial)
                                ecore_list_append(ewl_box_spread, child);
                }
        }
@@ -535,7 +539,7 @@
                         * If the child did not accept any of the size, then
                         * it's at it's max/min and is no longer useful.
                         */
-                       if (!temp || (*fill_size - temp < 0))
+                       if (!temp)
                                ecore_list_remove(ewl_box_spread);
                        else {
                                *fill_size -= temp;
@@ -676,7 +680,7 @@
  * When a child gets added to the box update it's size.
  */
 void
-ewl_box_child_show_cb(Ewl_Container * c, Ewl_Widget * w __UNUSED__)
+ewl_box_child_show_cb(Ewl_Container * c, Ewl_Widget * w)
 {
        int nodes, space = 0;
 




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to