]> source.dussan.org Git - vaadin-framework.git/commitdiff
IPanel setWidth changed: 100% won't go to outmost div element anymore, we let browser...
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 27 Feb 2008 11:22:58 +0000 (11:22 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 27 Feb 2008 11:22:58 +0000 (11:22 +0000)
svn changeset:3936/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java

index 621ff3f756fa4d570eaf8c7210535c7510686274..69c05223c1ba3c21d86fd6b061c069169585d807 100644 (file)
@@ -81,11 +81,10 @@ public class IPanel extends SimplePanel implements Paintable,
         id = uidl.getId();
 
         // Panel size. Height needs to be saved for later use
-        final String w = uidl.hasVariable("width") ? uidl
-                .getStringVariable("width") : null;
         height = uidl.hasVariable("height") ? uidl.getStringVariable("height")
                 : null;
-        super.setWidth(w != null ? w : "");
+        setWidth(uidl.hasVariable("width") ? uidl.getStringVariable("width")
+                : "");
 
         // Restore default stylenames
         DOM
@@ -312,7 +311,11 @@ public class IPanel extends SimplePanel implements Paintable,
      * Panel handles dimensions by itself.
      */
     public void setWidth(String width) {
-        // NOP
+        // Let browser handle 100% width (DIV element takes all size by default).
+        // This way we can specify borders for Panel's outer element.
+        if(!width.equals("100%")) {
+            super.setWidth(width);
+        }
     }
 
 }