]> source.dussan.org Git - vaadin-framework.git/commitdiff
Increased debug window default size (#8523)
authorArtur Signell <artur.signell@itmill.com>
Tue, 24 Apr 2012 12:24:50 +0000 (12:24 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 24 Apr 2012 12:24:50 +0000 (12:24 +0000)
svn changeset:23621/svn branch:6.8

src/com/vaadin/terminal/gwt/client/VDebugConsole.java

index c43581b0002aa77d9be570c336c9343b02673773..19b478b098f755020c245858d36181db9c9cbaf3 100644 (file)
@@ -170,6 +170,9 @@ public class VDebugConsole extends VOverlay implements Console {
     private static final String help = "Drag title=move, shift-drag=resize, doubleclick title=min/max."
             + "Use debug=quiet to log only to browser console.";
 
+    private static final int DEFAULT_WIDTH = 650;
+    private static final int DEFAULT_HEIGHT = 400;
+
     public VDebugConsole() {
         super(false, false);
         getElement().getStyle().setOverflow(Overflow.HIDDEN);
@@ -291,10 +294,20 @@ public class VDebugConsole extends VOverlay implements Console {
             height = Integer.parseInt(split[3]);
             autoScrollValue = Boolean.valueOf(split[4]);
         } else {
-            width = 400;
-            height = 150;
-            top = Window.getClientHeight() - 160;
-            left = Window.getClientWidth() - 410;
+            int windowHeight = Window.getClientHeight();
+            int windowWidth = Window.getClientWidth();
+            width = DEFAULT_WIDTH;
+            height = DEFAULT_HEIGHT;
+
+            if (height > windowHeight / 2) {
+                height = windowHeight / 2;
+            }
+            if (width > windowWidth / 2) {
+                width = windowWidth / 2;
+            }
+
+            top = windowHeight - (height + 10);
+            left = windowWidth - (width + 10);
         }
         setPixelSize(width, height);
         setPopupPosition(left, top);