From b5fa2a0936517ea3777a3edbb52fe61e0dca9c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20Damst=C3=A9n?= Date: Tue, 9 Oct 2007 07:05:37 +0000 Subject: [PATCH] Calculate available size before perItemSize svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=723274 --- widgets/boxlayout.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/widgets/boxlayout.cpp b/widgets/boxlayout.cpp index 08f73c07c..06cbfa034 100644 --- a/widgets/boxlayout.cpp +++ b/widgets/boxlayout.cpp @@ -396,12 +396,11 @@ void BoxLayout::setGeometry(const QRectF& geo) 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