From: Matti Tahvonen Date: Thu, 8 Jan 2009 14:36:52 +0000 (+0000) Subject: fixes #2437, regression due changes in ICaption. Most likely visible in other places... X-Git-Tag: 6.7.0.beta1~3383 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7cf525985a796861c352619b2713e7a6a4f63283;p=vaadin-framework.git fixes #2437, regression due changes in ICaption. Most likely visible in other places too, hopefully those are now fixed too. svn changeset:6463/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java index 9450579709..96cf81ea87 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java @@ -229,7 +229,15 @@ public class ICaption extends HTML { */ iconOnloadHandled = true; - setMaxWidth(maxWidth); + // if max width defined, recalculate + if (maxWidth != -1) { + setMaxWidth(maxWidth); + } else { + String width = getElement().getStyle().getProperty("width"); + if (width != null && !width.equals("")) { + setWidth(getRequiredWidth() + "px"); + } + } /* * The size of the icon might affect the size of the component so we