]> source.dussan.org Git - vaadin-framework.git/commitdiff
Make GridLayout react to caption size changes (#8313)
authorLeif Åstrand <leif@vaadin.com>
Thu, 16 Feb 2012 07:21:51 +0000 (09:21 +0200)
committerLeif Åstrand <leif@vaadin.com>
Thu, 16 Feb 2012 07:21:51 +0000 (09:21 +0200)
src/com/vaadin/terminal/gwt/client/ui/VGridLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java

index a753a403775c3e33719e61b5069bcd6fdaa3553f..909612933b66d889f841aa0c702317cdfe2bb88c 100644 (file)
@@ -174,7 +174,7 @@ public class VGridLayoutPaintable extends VAbstractPaintableWidgetContainer
         ChildComponentContainer cc = getWidgetForPaintable().widgetToComponentContainer
                 .get(widget);
         if (cc != null) {
-            cc.updateCaption(uidl, getConnection());
+            cc.updateCaption(uidl, getConnection(), getMeasuredSize());
         }
         if (!getWidgetForPaintable().rendering) {
             // ensure rel size details are updated
index dffb418660a0fc9e8658035f2809b8cabff89583..6972cfb587ef46ed537cd18a2be8c62201c99a9b 100644 (file)
@@ -14,6 +14,7 @@ import com.google.gwt.user.client.ui.Panel;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.MeasuredSize;
 import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
 import com.vaadin.terminal.gwt.client.RenderInformation.Size;
 import com.vaadin.terminal.gwt.client.UIDL;
@@ -406,7 +407,8 @@ public class ChildComponentContainer extends Panel {
         return widgetSize;
     }
 
-    public void updateCaption(UIDL uidl, ApplicationConnection client) {
+    public void updateCaption(UIDL uidl, ApplicationConnection client,
+            MeasuredSize parentSize) {
         if (VCaption.isNeeded(uidl)) {
             // We need a caption
 
@@ -416,6 +418,7 @@ public class ChildComponentContainer extends Panel {
                 newCaption = new VCaption(paintable, client);
                 // Set initial height to avoid Safari flicker
                 newCaption.setHeight("18px");
+                parentSize.registerDependency(newCaption.getElement());
                 // newCaption.setHeight(newCaption.getHeight()); // This might
                 // be better... ??
                 if (BrowserInfo.get().isIE()) {
@@ -436,6 +439,7 @@ public class ChildComponentContainer extends Panel {
         } else {
             // Caption is not needed
             if (caption != null) {
+                parentSize.deRegisterDependency(caption.getElement());
                 remove(caption);
             }