]> source.dussan.org Git - vaadin-framework.git/commitdiff
Put margin on caption's parent so caption's outer size can be used
authorLeif Åstrand <leif@vaadin.com>
Tue, 17 Apr 2012 12:04:43 +0000 (15:04 +0300)
committerLeif Åstrand <leif@vaadin.com>
Tue, 17 Apr 2012 12:04:43 +0000 (15:04 +0300)
src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java

index 32cf9cfb2e6d72987bb6b2b553d1211388469008..a8512762f1859c106330440ae959ff9368632681 100644 (file)
@@ -185,11 +185,12 @@ public class PanelConnector extends AbstractComponentContainerConnector
         VPanel panel = getWidget();
 
         LayoutManager layoutManager = getLayoutManager();
-        int top = layoutManager.getInnerHeight(panel.captionNode);
+        int top = layoutManager.getOuterHeight(panel.captionNode);
         int bottom = layoutManager.getInnerHeight(panel.bottomDecoration);
 
         Style style = panel.getElement().getStyle();
-        panel.captionNode.getStyle().setMarginTop(-top, Unit.PX);
+        panel.captionNode.getParentElement().getStyle()
+                .setMarginTop(-top, Unit.PX);
         panel.bottomDecoration.getStyle().setMarginBottom(-bottom, Unit.PX);
         style.setPaddingTop(top, Unit.PX);
         style.setPaddingBottom(bottom, Unit.PX);