diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-03-20 15:16:43 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-03-20 15:16:43 +0200 |
commit | c44cad36ff48991ca7b09df61308ecaa8a39d427 (patch) | |
tree | 1a18ed0dcf37f735c6bb532877af8592c4e88420 | |
parent | 118e74b23b0d911303c2b03ebb0d9fcc656c3b30 (diff) | |
download | vaadin-framework-c44cad36ff48991ca7b09df61308ecaa8a39d427.tar.gz vaadin-framework-c44cad36ff48991ca7b09df61308ecaa8a39d427.zip |
Take negative margin into account when calculating footer height (#8540)
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/LayoutManager.java | 18 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/FormConnector.java | 6 |
2 files changed, 21 insertions, 3 deletions
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); |