[Panel-devel] BoxLayout size calculating

Petri Damstén petri.damsten at iki.fi
Mon Oct 8 15:09:42 CEST 2007


Hi,

I think that available space should be calculated before perItemSize in 
BoxLayout. At least works better in my applets.

Index: widgets/boxlayout.cpp
===================================================================
--- widgets/boxlayout.cpp       (revision 722996)
+++ widgets/boxlayout.cpp       (working copy)
@@ -396,12 +396,11 @@
         else
             expansionSpace[i] = 0;

+        available -= sizes[i];
         // adjust the per-item size if the space was over or under used
         if ( sizes[i] != perItemSize && i != sizes.count()-1 ) {
             perItemSize = available / (sizes.count()-i-1);
         }
-
-        available -= sizes[i];
     }

     // distribute out any remaining space to items which can still expand

Petri

-- 
"Windows isn't a virus, viruses do something."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071008/dba14b16/attachment.pgp 


More information about the Panel-devel mailing list