aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Alhroos <john.ahlroos@itmill.com>2011-10-06 10:22:49 +0000
committerJohn Alhroos <john.ahlroos@itmill.com>2011-10-06 10:22:49 +0000
commitf992753cc49b67919ae41600d14606616ce093c3 (patch)
treeb66c36bb1ea5156db78c8fb6aca9801c5177ea83 /src
parent966ed9f9c3225cf6afbee633ebd03d81d5527d97 (diff)
downloadvaadin-framework-f992753cc49b67919ae41600d14606616ce093c3.tar.gz
vaadin-framework-f992753cc49b67919ae41600d14606616ce093c3.zip
Revised [21596] miscalculation fix to take possibly set CSS paddings into consideration.
svn changeset:21597/svn branch:6.7
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VForm.java7
1 files changed, 5 insertions, 2 deletions
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;