From d434bfd1d35f576a3b9ae5f3288464990a6106dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Tue, 7 Feb 2012 15:07:09 +0200 Subject: [PATCH] Make container instead of child depend on child caption (#8313) --- .../ui/VMeasuringOrderedLayoutPaintable.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java index f1838cf30e..c13ebc87f3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java @@ -31,10 +31,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends getWidgetForPaintable().addCaption(caption, widget); getWidgetForPaintable().captions.put(component, caption); - MeasureManager.MeasuredSize measuredSize = component - .getMeasuredSize(); - - measuredSize.registerDependency(caption.getElement()); + getMeasuredSize().registerDependency(caption.getElement()); } caption.updateCaption(uidl); } else { @@ -42,9 +39,8 @@ public abstract class VMeasuringOrderedLayoutPaintable extends .remove(component); if (removedCaption != null) { getWidgetForPaintable().remove(removedCaption); - MeasureManager.MeasuredSize measuredSize = component - .getMeasuredSize(); - measuredSize.deRegisterDependency(removedCaption.getElement()); + getMeasuredSize().deRegisterDependency( + removedCaption.getElement()); } } } @@ -121,18 +117,15 @@ public abstract class VMeasuringOrderedLayoutPaintable extends if (caption == null) { return 0; } else { - MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize(); - return measuredSize.getDependencyWidth(caption.getElement()); + return getMeasuredSize().getDependencyWidth(caption.getElement()); } } private int getCaptionHeight(VPaintableWidget child) { - VCaption caption = getWidgetForPaintable().captions.get(child); if (caption != null) { - MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize(); - int captionHeight = measuredSize.getDependencyHeight(caption - .getElement()); + int captionHeight = getMeasuredSize().getDependencyHeight( + caption.getElement()); caption.getElement().getStyle() .setMarginTop(-captionHeight, Unit.PX); -- 2.39.5