From: Jouni Koivuviita Date: Wed, 18 Apr 2012 11:34:12 +0000 (+0300) Subject: Fixed negative padding setting for IE8 in BoxLayout. Fixed vertical implicit expand... X-Git-Tag: 7.0.0.beta1~264 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8d84994be8cdae19c5e2e22f7223614453e0ef1d;p=vaadin-framework.git Fixed negative padding setting for IE8 in BoxLayout. Fixed vertical implicit expand ratio distribution for BoxLayout --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java index 3d1aa1d697..b4df5215bd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java @@ -142,7 +142,7 @@ public abstract class AbstractBoxLayoutConnector extends // extra space equally if no expand ratios are specified inside a // layout with specified size if (expandRatios.getKeySet().size() == 0 - && ((!getWidget().vertical && !isUndefinedHeight()) || !isUndefinedWidth())) { + && ((getWidget().vertical && !isUndefinedHeight()) || !isUndefinedWidth())) { expandRatio = 1; hasExpandRatio.add(child); } else if (expandRatios.containsKey(pid) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java index fcb76783cd..29c619434f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java @@ -608,16 +608,19 @@ public class VBoxLayout extends FlowPanel { if (layoutManager != null) { // TODO check caption position if (vertical) { - totalSize += layoutManager.getOuterHeight(slot + int size = layoutManager.getOuterHeight(slot .getWidget().getElement()) - layoutManager.getMarginHeight(slot .getWidget().getElement()); if (slot.hasCaption()) { - totalSize += layoutManager.getOuterHeight(slot + size += layoutManager.getOuterHeight(slot .getCaptionElement()) - layoutManager.getMarginHeight(slot .getCaptionElement()); } + if (size > 0) { + totalSize += size; + } } else { int max = -1; max = layoutManager.getOuterWidth(slot.getWidget() @@ -631,7 +634,9 @@ public class VBoxLayout extends FlowPanel { .getCaptionElement()); max = Math.max(max, max2); } - totalSize += max; + if (max > 0) { + totalSize += max; + } } } else { totalSize += vertical ? slot.getOffsetHeight() : slot @@ -639,7 +644,10 @@ public class VBoxLayout extends FlowPanel { } } // TODO fails in Opera, always returns 0 - totalSize += slot.getSpacingSize(vertical); + int spacingSize = slot.getSpacingSize(vertical); + if (spacingSize > 0) { + totalSize += spacingSize; + } } // When we set the margin to the first child, we don't need