From 9cd424839b298944431e1cb7451341e97eced9d2 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 15 Dec 2008 14:09:45 +0000 Subject: Fix for #2325 - SubWindow with relative sized layout broken svn changeset:6211/svn branch:trunk --- .../toolkit/terminal/gwt/client/ui/IWindow.java | 31 +++++++++++++++------- 1 file 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 -- cgit v1.2.3