]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed negative padding setting for IE8 in BoxLayout. Fixed vertical implicit expand...
authorJouni Koivuviita <jouni@jounikoivuviita.com>
Wed, 18 Apr 2012 11:34:12 +0000 (14:34 +0300)
committerJouni Koivuviita <jouni@jounikoivuviita.com>
Wed, 18 Apr 2012 11:34:12 +0000 (14:34 +0300)
src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java
src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java

index 3d1aa1d697595085b71f33906b317deb7dfcfa8b..b4df5215bde091ee81e032a41be0fb3e609be1bf 100644 (file)
@@ -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)
index fcb76783cdb52ccc50daebf0ed14158147159efb..29c619434f3051be8a491434d874da183981d495 100644 (file)
@@ -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