]> source.dussan.org Git - vaadin-framework.git/commitdiff
merged [11905] from 6.3
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 16 Mar 2010 09:11:05 +0000 (09:11 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 16 Mar 2010 09:11:05 +0000 (09:11 +0000)
svn changeset:11906/svn branch:6.2

src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java

index 90cf102cb9434179ba6a644ffbf9f407359656cb..5307234869c616a9d6021cd349eb054568155bb5 100644 (file)
@@ -55,6 +55,7 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
 
     private boolean hasHeight;
     private boolean hasWidth;
+    private boolean rendering;
 
     public VCssLayout() {
         super();
@@ -74,6 +75,9 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
         super.setWidth(width);
         // panel.setWidth(width);
         hasWidth = width != null && !width.equals("");
+        if (!rendering) {
+            panel.updateRelativeSizes();
+        }
     }
 
     @Override
@@ -81,11 +85,16 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
         super.setHeight(height);
         // panel.setHeight(height);
         hasHeight = height != null && !height.equals("");
+        if (!rendering) {
+            panel.updateRelativeSizes();
+        }
     }
 
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+        rendering = true;
 
         if (client.updateComponent(this, uidl, true)) {
+            rendering = false;
             return;
         }
         clickEventHandler.handleEventHandlerRegistration(client);
@@ -104,6 +113,7 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
         setStyleName(margin, CLASSNAME + "-" + "spacing", uidl
                 .hasAttribute("spacing"));
         panel.updateFromUIDL(uidl, client);
+        rendering = false;
     }
 
     public boolean hasChildComponent(Widget component) {
@@ -128,6 +138,14 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
             setStyleName(CLASSNAME + "-container");
         }
 
+        public void updateRelativeSizes() {
+            for (Widget w : getChildren()) {
+                if (w instanceof Paintable) {
+                    client.handleComponentRelativeSize(w);
+                }
+            }
+        }
+
         public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
 
             // for later requests