]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed expand ratio calculations for BoxLayout (was not taking caption width into...
authorJouni Koivuviita <jouni@jounikoivuviita.com>
Wed, 18 Apr 2012 09:56:50 +0000 (12:56 +0300)
committerJouni Koivuviita <jouni@jounikoivuviita.com>
Wed, 18 Apr 2012 09:56:50 +0000 (12:56 +0300)
src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java

index 8f9980bf5ad8cad6e2f9762c2a6776631d0b844f..540ad58c2b7255c6763ee2b24ed6a11283bb91db 100644 (file)
@@ -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