]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #2437, regression due changes in ICaption. Most likely visible in other places...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 8 Jan 2009 14:36:52 +0000 (14:36 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 8 Jan 2009 14:36:52 +0000 (14:36 +0000)
svn changeset:6463/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ICaption.java

index 94505797098cbc0df634259590042f2194089067..96cf81ea871184d00c5993dce791f74cb0e8963b 100644 (file)
@@ -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