From: Artur Signell Date: Mon, 26 Nov 2012 17:58:16 +0000 (+0200) Subject: Fix resize of a Window with a single component (#10375) X-Git-Tag: 7.0.0.beta11~134^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=515c3993e81025515aefe1af18a5a9bf80ce5686;p=vaadin-framework.git Fix resize of a Window with a single component (#10375) Change-Id: I04d2d39b61ee5fb841511dd23d6f674089cff916 --- diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index 0885077111..1b35b020f2 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -744,8 +744,11 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, private void updateContentsSize() { // Update child widget dimensions if (client != null) { - client.handleComponentRelativeSize(layout.getWidget()); - client.runDescendentsLayout((HasWidgets) layout.getWidget()); + Widget childWidget = layout.getWidget(); + client.handleComponentRelativeSize(childWidget); + if (childWidget instanceof HasWidgets) { + client.runDescendentsLayout((HasWidgets) childWidget); + } } LayoutManager layoutManager = LayoutManager.get(client); diff --git a/uitest/src/com/vaadin/tests/components/ui/WindowWithLabel.java b/uitest/src/com/vaadin/tests/components/ui/WindowWithLabel.java new file mode 100644 index 0000000000..994c0692e0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/WindowWithLabel.java @@ -0,0 +1,27 @@ +package com.vaadin.tests.components.ui; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; +import com.vaadin.ui.Window; + +public class WindowWithLabel extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + setContent(new Label("UI")); + Window window = new Window("A window"); + addWindow(window); + } + + @Override + protected String getTestDescription() { + return "Resize the window. It should work."; + } + + @Override + protected Integer getTicketNumber() { + return 10375; + } + +}