Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_row.c ewl_row.h 


Log Message:
This child list should be short, so use the common ewl_container_prefer_largest
function.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_row.c   14 Nov 2003 21:25:26 -0000      1.19
+++ ewl_row.c   15 Nov 2003 20:24:12 -0000      1.20
@@ -225,20 +225,11 @@
 static void
 __ewl_row_add(Ewl_Container *c, Ewl_Widget *w)
 {
-       int size;
        Ewl_Row *row;
 
        row = EWL_ROW(c);
 
-       /*
-        * Adjust the preferred height to the largest widget added.
-        */
-       size = ewl_object_get_preferred_h(EWL_OBJECT(w));
-       if (!row->max || ewl_object_get_preferred_h(row->max) > size) {
-               row->max = EWL_OBJECT(w);
-               ewl_object_set_preferred_h(EWL_OBJECT(c), size);
-       }
-
+       ewl_container_prefer_largest(c, EWL_ORIENTATION_VERTICAL);
        ewl_object_set_preferred_w(EWL_OBJECT(c), PREFERRED_W(c) +
                        ewl_object_get_preferred_w(EWL_OBJECT(w)));
 }
@@ -248,33 +239,14 @@
 {
        Ewl_Row *row;
 
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
        row = EWL_ROW(c);
-       if (o == EWL_ORIENTATION_VERTICAL) {
-               if (EWL_OBJECT(w) == row->max && size > 0)
-                       ewl_object_set_preferred_h(EWL_OBJECT(c),
-                                       PREFERRED_H(c) + size);
-               else {
-                       int h;
-                       int max_h = 0;
-                       Ewl_Object *child;
-
-                       /*
-                        * Search out the tallest widget in the row
-                        */
-                       ewd_list_goto_first(c->children);
-                       while ((child = ewd_list_next(c->children))) {
-                               h = ewl_object_get_preferred_h(child);
-                               if (h > max_h) {
-                                       max_h = h;
-                                       row->max = child;
-                               }
-                       }
-
-                       PREFERRED_H(c) = max_h;
-               }
-       }
-       else {
+       if (o == EWL_ORIENTATION_VERTICAL)
+               ewl_container_prefer_largest(c, EWL_ORIENTATION_VERTICAL);
+       else
                ewl_object_set_preferred_w(EWL_OBJECT(c),
                                PREFERRED_W(c) + size);
-       }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_row.h   22 Sep 2003 06:09:24 -0000      1.9
+++ ewl_row.h   15 Nov 2003 20:24:12 -0000      1.10
@@ -10,8 +10,6 @@
 struct _ewl_row
 {
        Ewl_Container container;
-       Ewl_Object *max;
-
        Ewl_Row *header;
 };
 




-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to