From: Leif Åstrand Date: Tue, 20 Mar 2012 13:16:43 +0000 (+0200) Subject: Take negative margin into account when calculating footer height (#8540) X-Git-Tag: 7.0.0.alpha2~294 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c44cad36ff48991ca7b09df61308ecaa8a39d427;p=vaadin-framework.git Take negative margin into account when calculating footer height (#8540) --- diff --git a/src/com/vaadin/terminal/gwt/client/LayoutManager.java b/src/com/vaadin/terminal/gwt/client/LayoutManager.java index 891f145efb..a593754c17 100644 --- a/src/com/vaadin/terminal/gwt/client/LayoutManager.java +++ b/src/com/vaadin/terminal/gwt/client/LayoutManager.java @@ -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(); } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java b/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java index 05db22e6ae..ff3950f37d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java @@ -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);