From: John Alhroos Date: Thu, 6 Oct 2011 10:22:49 +0000 (+0000) Subject: Revised [21596] miscalculation fix to take possibly set CSS paddings into consideration. X-Git-Tag: 6.7.1~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f992753cc49b67919ae41600d14606616ce093c3;p=vaadin-framework.git Revised [21596] miscalculation fix to take possibly set CSS paddings into consideration. svn changeset:21597/svn branch:6.7 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VForm.java b/src/com/vaadin/terminal/gwt/client/ui/VForm.java index 18e0a3790d..8b682d65d1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VForm.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VForm.java @@ -74,6 +74,9 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler { errorIndicatorElement.getStyle().setDisplay(Display.NONE); errorIndicatorElement.setInnerText(" "); // needed for IE desc.setClassName("v-form-description"); + fieldSet.appendChild(desc); // Adding description for initial padding + // measurements, removed later if no + // description is set fieldSet.appendChild(fieldContainer); errorMessage.setVisible(false); errorMessage.setStyleName(CLASSNAME + "-errormessage"); @@ -300,9 +303,9 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler { @Override public void setWidth(String width) { - if (borderPaddingHorizontal < 0 && desc.hasParentElement()) { + if (borderPaddingHorizontal < 0) { // measure excess size lazily after stylename setting, but before - // setting width if description is attached + // setting width int ow = getOffsetWidth(); int dow = desc.getOffsetWidth(); borderPaddingHorizontal = ow - dow;