summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni@jounikoivuviita.com>2012-05-21 13:27:48 +0300
committerJouni Koivuviita <jouni@jounikoivuviita.com>2012-05-21 13:27:48 +0300
commitef744edf4a0e849932d30bd9d6870ec15f391225 (patch)
tree8112ae231b3ed0bc40c46487635c8ac4a5b5c384 /src/com/vaadin/terminal
parent9f41984a9b36ab49303fa02d9cb756b4377d85b9 (diff)
downloadvaadin-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.java15
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);