From df54fe0c5315bc7ce08ec262094e4e099506cc25 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Mon, 26 May 2008 09:17:41 +0000 Subject: [PATCH] avoid small gap in form legend if no icon or caption svn changeset:4629/svn branch:trunk --- src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java index 3372f28eac..98d3ac7077 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java @@ -58,8 +58,10 @@ public class IForm extends ComplexPanel implements Paintable, return; } + boolean legendEmpty = true; if (uidl.hasAttribute("caption")) { DOM.setInnerText(caption, uidl.getStringAttribute("caption")); + legendEmpty = false; } else { DOM.setInnerText(caption, ""); } @@ -69,11 +71,17 @@ public class IForm extends ComplexPanel implements Paintable, DOM.insertChild(legend, icon.getElement(), 0); } icon.setUri(uidl.getStringAttribute("icon")); + legendEmpty = false; } else { if (icon != null) { DOM.removeChild(legend, icon.getElement()); } } + if (legendEmpty) { + DOM.setStyleAttribute(legend, "display", "none"); + } else { + DOM.setStyleAttribute(legend, "display", ""); + } if (uidl.hasAttribute("error")) { final UIDL errorUidl = uidl.getErrors(); -- 2.39.5