From: Jouni Koivuviita Date: Wed, 18 Apr 2012 09:56:50 +0000 (+0300) Subject: Fixed expand ratio calculations for BoxLayout (was not taking caption width into... X-Git-Tag: 7.0.0.beta1~268 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c4912c245ae5f2721b755d6f92ee04c2c8f54f6;p=vaadin-framework.git Fixed expand ratio calculations for BoxLayout (was not taking caption width into account when horizontal expand was used) --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java index 8f9980bf5a..540ad58c2b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java @@ -616,10 +616,19 @@ public class VBoxLayout extends FlowPanel { .getCaptionElement()); } } else { - totalSize += layoutManager.getOuterWidth(slot - .getWidget().getElement()) + int max = -1; + max = layoutManager.getOuterWidth(slot.getWidget() + .getElement()) - layoutManager.getMarginWidth(slot .getWidget().getElement()); + if (slot.hasCaption()) { + int max2 = layoutManager.getOuterWidth(slot + .getCaptionElement()) + - layoutManager.getMarginWidth(slot + .getCaptionElement()); + max = Math.max(max, max2); + } + totalSize += max; } } else { totalSize += vertical ? slot.getOffsetHeight() : slot