From 7cf525985a796861c352619b2713e7a6a4f63283 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Thu, 8 Jan 2009 14:36:52 +0000 Subject: [PATCH] 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 --- .../itmill/toolkit/terminal/gwt/client/ICaption.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.5