Update of /cvsroot/freevo/freevo/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv7599

Modified Files:
        LayoutManagers.py 
Log Message:
add internal_v_align == Align.CENTER for more than one row

Index: LayoutManagers.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/LayoutManagers.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** LayoutManagers.py   26 Jun 2003 01:46:49 -0000      1.10
--- LayoutManagers.py   1 Sep 2003 18:49:33 -0000       1.11
***************
*** 12,15 ****
--- 12,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.11  2003/09/01 18:49:33  dischi
+ # add internal_v_align == Align.CENTER for more than one row
+ #
  # Revision 1.10  2003/06/26 01:46:49  rshortt
  # Set DEBUG back to 0 as to not annoy everyone with my insane debug statements
***************
*** 242,253 ****
  
  
          for row in self.table:
!             if not len(row): continue
!             row_width = 0
              for child in row:
                  row_width += child.width
                  if len(row) - row.index(child) > 1:
                      row_width += self.container.h_spacing
  
              if self.container.internal_h_align == Align.CENTER:
                  row_center = row[0].left + row_width / 2
--- 245,263 ----
  
  
+         global_height = 0
          for row in self.table:
!             if not len(row):
!                 continue
! 
!             row_width  = 0
!             row_height = 0
              for child in row:
                  row_width += child.width
+                 row_height = max(row_height, child.height)
                  if len(row) - row.index(child) > 1:
                      row_width += self.container.h_spacing
  
+             global_height += row_height + self.container.v_spacing
+             
              if self.container.internal_h_align == Align.CENTER:
                  row_center = row[0].left + row_width / 2
***************
*** 263,266 ****
--- 273,287 ----
                  row[0].left += x_offset
                  if DEBUG: print '            moved right by %s' % x_offset
+ 
+ 
+         if len(self.table) == 1:
+             space = self.container.height - self.container.v_spacing - global_height
+             shift = space / (len(self.table) + 4)
+             if self.container.internal_v_align == Align.CENTER and shift > 0:
+                 current = 2 * shift
+                 for row in self.table:
+                     for child in row:
+                         child.top += current
+                     current += shift
  
  




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to