]> source.dussan.org Git - vaadin-framework.git/commitdiff
Take negative margin into account when calculating footer height (#8540)
authorLeif Åstrand <leif@vaadin.com>
Tue, 20 Mar 2012 13:16:43 +0000 (15:16 +0200)
committerLeif Åstrand <leif@vaadin.com>
Tue, 20 Mar 2012 13:16:43 +0000 (15:16 +0200)
src/com/vaadin/terminal/gwt/client/LayoutManager.java
src/com/vaadin/terminal/gwt/client/ui/FormConnector.java

index 891f145efbb4a7911a1f02d599a32f4019117e88..a593754c17c03d5f6cefc09d6528628b1cd8dbde 100644 (file)
@@ -358,6 +358,22 @@ public class LayoutManager {
     }
 
     public int getPaddingRight(Element element) {
-        return getMeasuredSize(element, null).getPaddingRight();
+        return getMeasuredSize(element, nullSize).getPaddingRight();
+    }
+
+    public int getMarginTop(Element element) {
+        return getMeasuredSize(element, nullSize).getMarginTop();
+    }
+
+    public int getMarginRight(Element element) {
+        return getMeasuredSize(element, nullSize).getMarginRight();
+    }
+
+    public int getMarginBottom(Element element) {
+        return getMeasuredSize(element, nullSize).getMarginBottom();
+    }
+
+    public int getMarginLeft(Element element) {
+        return getMeasuredSize(element, nullSize).getMarginLeft();
     }
 }
index 05db22e6ae15876fc648508e9c786141c02c2eb2..ff3950f37dfd91322d2790928eb73ba6fd96ab13 100644 (file)
@@ -12,6 +12,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ComponentState;
 import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.LayoutManager;
 import com.vaadin.terminal.gwt.client.UIDL;
 
 public class FormConnector extends AbstractComponentContainerConnector
@@ -171,8 +172,9 @@ public class FormConnector extends AbstractComponentContainerConnector
     public void layout() {
         VForm form = getWidget();
 
-        int footerHeight = getLayoutManager().getOuterHeight(
-                form.footerContainer);
+        LayoutManager lm = getLayoutManager();
+        int footerHeight = lm.getOuterHeight(form.footerContainer)
+                - lm.getMarginTop(form.footerContainer);
 
         form.fieldContainer.getStyle().setPaddingBottom(footerHeight, Unit.PX);
         form.footerContainer.getStyle().setMarginTop(-footerHeight, Unit.PX);