diff options
author | Jouni Koivuviita <jouni@jounikoivuviita.com> | 2012-04-18 12:56:50 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@jounikoivuviita.com> | 2012-04-18 12:56:50 +0300 |
commit | 3c4912c245ae5f2721b755d6f92ee04c2c8f54f6 (patch) | |
tree | 95907b341d2bfe347ec80b9b38d3082d2bb04085 | |
parent | 14e8bbbc3d6c6f05435cf553b130d2a31bac0a39 (diff) | |
download | vaadin-framework-3c4912c245ae5f2721b755d6f92ee04c2c8f54f6.tar.gz vaadin-framework-3c4912c245ae5f2721b755d6f92ee04c2c8f54f6.zip |
Fixed expand ratio calculations for BoxLayout (was not taking caption width into account when horizontal expand was used)
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java | 13 |
1 files changed, 11 insertions, 2 deletions
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 |