aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2008-12-15 14:09:45 +0000
committerArtur Signell <artur.signell@itmill.com>2008-12-15 14:09:45 +0000
commit9cd424839b298944431e1cb7451341e97eced9d2 (patch)
tree4ec4f0797323e3a19388bb45bd7200dae49dc6a5
parent3626ad212e9f5d3347b45dbea803a34b7e1f412e (diff)
downloadvaadin-framework-9cd424839b298944431e1cb7451341e97eced9d2.tar.gz
vaadin-framework-9cd424839b298944431e1cb7451341e97eced9d2.zip
Fix for #2325 - SubWindow with relative sized layout broken
svn changeset:6211/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
index b9fa80554c..6368276b90 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
@@ -305,20 +305,31 @@ public class IWindow extends IToolkitOverlay implements Container,
}
boolean dynamicWidth = !uidl.hasAttribute("width");
+ boolean dynamicHeight = !uidl.hasAttribute("height");
boolean widthHasBeenFixed = false;
String layoutWidth = childUidl.getStringAttribute("width");
- if (dynamicWidth) {
- if (layoutWidth != null && layoutWidth.contains("%")) {
- /*
- * Relative layout width, fix window width before rendering
- * (width according to caption)
- */
- widthHasBeenFixed = true;
- setNaturalWidth();
- }
+ boolean layoutRelativeWidth = (layoutWidth != null && layoutWidth
+ .endsWith("%"));
+
+ if (dynamicWidth && layoutRelativeWidth) {
+ /*
+ * Relative layout width, fix window width before rendering (width
+ * according to caption)
+ */
+ widthHasBeenFixed = true;
+ setNaturalWidth();
+ }
+
+ layout.updateFromUIDL(childUidl, client);
+ if (!dynamicHeight && layoutRelativeWidth) {
+ /*
+ * Relative layout width, and fixed height. Must update the size to
+ * be able to take scrollbars into account (layout gets narrower
+ * space if it is higher than the window) -> only vertical scrollbar
+ */
+ client.handleComponentRelativeSize((Widget) layout);
}
- lo.updateFromUIDL(childUidl, client);
/*
* No explicit width is set and the layout does not have relative width