diff options
author | Jouni Koivuviita <jouni@jounikoivuviita.com> | 2012-05-21 13:27:48 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@jounikoivuviita.com> | 2012-05-21 13:27:48 +0300 |
commit | ef744edf4a0e849932d30bd9d6870ec15f391225 (patch) | |
tree | 8112ae231b3ed0bc40c46487635c8ac4a5b5c384 /src/com/vaadin/terminal | |
parent | 9f41984a9b36ab49303fa02d9cb756b4377d85b9 (diff) | |
download | vaadin-framework-ef744edf4a0e849932d30bd9d6870ec15f391225.tar.gz vaadin-framework-ef744edf4a0e849932d30bd9d6870ec15f391225.zip |
Fixed equal expand ratio for BoxLayout (no expand ratios set for defined sized layout)
Diffstat (limited to 'src/com/vaadin/terminal')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java index 25d917b7e8..854b02018f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java @@ -216,6 +216,17 @@ public abstract class AbstractBoxLayoutConnector extends hasRelativeHeight.clear(); needsMeasure.clear(); + boolean equalExpandRatio = getWidget().vertical ? !isUndefinedHeight() + : !isUndefinedWidth(); + for (ComponentConnector child : getChildren()) { + double expandRatio = getState().getChildData().get(child) + .getExpandRatio(); + if (expandRatio > 0) { + equalExpandRatio = false; + break; + } + } + for (ComponentConnector child : getChildren()) { Slot slot = getWidget().getSlot(child); @@ -225,7 +236,9 @@ public abstract class AbstractBoxLayoutConnector extends double expandRatio = getState().getChildData().get(child) .getExpandRatio(); - if (expandRatio == 0) { + if (equalExpandRatio) { + expandRatio = 1; + } else if (expandRatio == 0) { expandRatio = -1; } slot.setExpandRatio(expandRatio); |