Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_box.c 


Log Message:
Now that the fill policy model is more stable, revert to faster old box size
calculation.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_box.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_box.c   24 Oct 2005 04:39:57 -0000      1.12
+++ ewl_box.c   1 Nov 2005 23:26:33 -0000       1.13
@@ -735,6 +735,8 @@
 ewl_box_child_show_cb(Ewl_Container * c, Ewl_Widget * w)
 {
        int nodes, space = 0;
+       int width, height;
+       int cw, ch;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("c", c);
@@ -748,21 +750,28 @@
        space = EWL_BOX(c)->spacing * nodes;
 
        /*
+        * Get the sizes common to both calculations.
+        */
+       width = ewl_object_preferred_inner_w_get(EWL_OBJECT(c));
+       height = ewl_object_preferred_inner_h_get(EWL_OBJECT(c));
+
+       cw = ewl_object_preferred_w_get(EWL_OBJECT(w));
+       ch = ewl_object_preferred_h_get(EWL_OBJECT(w));
+
+       /*
         * Base the info used on the orientation of the box.
         */
        if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) {
-               int width;
-               ewl_container_sum_prefer(c, EWL_ORIENTATION_HORIZONTAL);
-               ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
-               width = ewl_object_preferred_inner_w_get(EWL_OBJECT(c));
-               ewl_object_preferred_inner_w_set(EWL_OBJECT(c), width + space);
+               cw += space;
+               ewl_object_preferred_inner_w_set(EWL_OBJECT(c), width + cw);
+               if (ch > height)
+                       ewl_object_preferred_inner_h_set(EWL_OBJECT(c), ch);
        }
        else {
-               int height;
-               ewl_container_sum_prefer(c, EWL_ORIENTATION_VERTICAL);
-               ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
-               height = ewl_object_preferred_inner_h_get(EWL_OBJECT(c));
-               ewl_object_preferred_inner_h_set(EWL_OBJECT(c), height + space);
+               ch += space;
+               if (cw > width)
+                       ewl_object_preferred_inner_w_set(EWL_OBJECT(c), cw);
+               ewl_object_preferred_inner_h_set(EWL_OBJECT(c), height + ch);
        }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to