From: Jouni Koivuviita Date: Fri, 2 Nov 2007 07:57:55 +0000 (+0000) Subject: Size information sent again as variables, like it should. X-Git-Tag: 6.7.0.beta1~5711 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=986f6918e68a7f1e695815282e8102c3c5221750;p=vaadin-framework.git Size information sent again as variables, like it should. svn changeset:2667/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/ui/Panel.java b/src/com/itmill/toolkit/ui/Panel.java index 81a7eea6ff..6cea4db208 100644 --- a/src/com/itmill/toolkit/ui/Panel.java +++ b/src/com/itmill/toolkit/ui/Panel.java @@ -182,7 +182,24 @@ public class Panel extends AbstractLayout implements Scrollable, public void paintContent(PaintTarget target) throws PaintException { layout.paint(target); - super.paintContent(target); + // We need to add these variables here ourselves, because Panel needs + // width and height as variables, not attributes + + // Add margin info. Defaults to false. + if (margins == null) + setMargin(false); + target.addAttribute("marginTop", margins[0]); + target.addAttribute("marginRight", margins[1]); + target.addAttribute("marginBottom", margins[2]); + target.addAttribute("marginLeft", margins[3]); + + // Add size info + if (getHeight() > -1) + target.addVariable(this, "height", getHeight() + + UNIT_SYMBOLS[getHeightUnits()]); + if (getWidth() > -1) + target.addVariable(this, "width", getWidth() + + UNIT_SYMBOLS[getWidthUnits()]); if (isScrollable()) { target.addVariable(this, "scrollleft", getScrollOffsetX());