]> source.dussan.org Git - vaadin-framework.git/commitdiff
IWindow now sizes itself respective to its content if no size is explicitly specified...
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Mon, 7 Apr 2008 07:40:21 +0000 (07:40 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Mon, 7 Apr 2008 07:40:21 +0000 (07:40 +0000)
svn changeset:4132/svn branch:trunk

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

index c8dd06824f8e890bbb522515c972ce5a68391155..63ab0477be4098d694dd16023aa868e96e571551 100644 (file)
@@ -33,10 +33,6 @@ import com.itmill.toolkit.terminal.gwt.client.Util;
  */
 public class IWindow extends PopupPanel implements Paintable, ScrollListener {
 
-    private static final int DEFAULT_HEIGHT = 300;
-
-    private static final int DEFAULT_WIDTH = 400;
-
     private static final int MIN_HEIGHT = 60;
 
     private static final int MIN_WIDTH = 80;
@@ -184,10 +180,6 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener {
         DOM.setElementProperty(getElement(), "className", CLASSNAME);
 
         setWidget(contentPanel);
-
-        // set default size
-        setWidth(DEFAULT_WIDTH + "px");
-        setHeight(DEFAULT_HEIGHT + "px");
     }
 
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
@@ -245,7 +237,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener {
         int childIndex = 0;
         UIDL childUidl = uidl.getChildUIDL(childIndex++);
         while ("open".equals(childUidl.getTag())) {
-            // TODO multipe opens with the same target will in practice just
+            // TODO multiple opens with the same target will in practice just
             // open the last one - should we fix that somehow?
             final String parsedUri = client.translateToolkitUri(childUidl
                     .getStringAttribute("src"));
@@ -301,13 +293,13 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener {
                             final String parsedUri = client
                                     .translateToolkitUri(notification
                                             .getStringAttribute("icon"));
-                            html += "<IMG src=\"" + parsedUri + "\" />";
+                            html += "<img src=\"" + parsedUri + "\" />";
                         }
                         if (notification.hasAttribute("caption")) {
-                            html += "<H1>"
+                            html += "<h1>"
                                     + notification
                                             .getStringAttribute("caption")
-                                    + "</H1>";
+                                    + "</h1>";
                         }
                         if (notification.hasAttribute("message")) {
                             html += "<p>"
@@ -443,8 +435,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener {
             resizing = true;
             startX = DOM.eventGetScreenX(event);
             startY = DOM.eventGetScreenY(event);
-            origW = DOM.getIntStyleAttribute(getElement(), "width")
-                    - BORDER_WIDTH_HORIZONTAL;
+            origW = getWidget().getOffsetWidth();
             origH = getWidget().getOffsetHeight();
             DOM.setCapture(getElement());
             break;