]> source.dussan.org Git - vaadin-framework.git/commitdiff
For #1859 "error messages overflow popup"; made tooltip maxwidth wider, overflow...
authorMarc Englund <marc.englund@itmill.com>
Tue, 1 Jul 2008 08:12:26 +0000 (08:12 +0000)
committerMarc Englund <marc.englund@itmill.com>
Tue, 1 Jul 2008 08:12:26 +0000 (08:12 +0000)
svn changeset:4991/svn branch:trunk

WebContent/ITMILL/themes/default/caption/caption.css
WebContent/ITMILL/themes/default/styles.css
src/com/itmill/toolkit/terminal/gwt/client/Tooltip.java

index be808b3fc2975d10240d5a1d84def7c6c41323ab..9ab7505c2b3e2667b6d55447fea3364b7f0e5877 100644 (file)
@@ -35,4 +35,5 @@
        padding: 7px;
        background-color: #FFE0E0;
        border: 1px solid #FFB0B0;
-}
\ No newline at end of file
+       overflow: auto;
+}
index be65f2a6e524e50e73b5102809d89fd2fd7188a4..0ad6b4849febceb38afcd4ec9c188815a9f5ec1f 100644 (file)
@@ -99,6 +99,7 @@
        padding: 7px;
        background-color: #FFE0E0;
        border: 1px solid #FFB0B0;
+       overflow: auto;
 }
 /* body tag created by servlet */
 .i-generated-body {
index 93f6f3be798ef6f35377fe2dca7b359f539639a1..cf1d6bd28023095e3bc6fcfcd3e7f8b06b44a79c 100644 (file)
@@ -20,12 +20,12 @@ public class Tooltip extends ToolkitOverlay {
     public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN
             | Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONMOUSEMOVE
             | Event.ONCLICK;
-    protected static final int MAX_WIDTH = 280;
+    protected static final int MAX_WIDTH = 500;
     ErrorMessage em = new ErrorMessage();
     Element description = DOM.createDiv();
     private Paintable tooltipOwner;
-    private boolean closing;
-    private boolean opening;
+    private boolean closing = false;
+    private boolean opening = false;
     private ApplicationConnection ac;
 
     public Tooltip(ApplicationConnection client) {
@@ -79,6 +79,7 @@ public class Tooltip extends ToolkitOverlay {
                     }
 
                     setPopupPosition(x, y);
+                    sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT);
                 }
             });
         } else {
@@ -135,6 +136,7 @@ public class Tooltip extends ToolkitOverlay {
             return;
         }
         closeTimer.schedule(300);
+        closing = true;
     }
 
     private int tooltipEventMouseX;
@@ -162,4 +164,22 @@ public class Tooltip extends ToolkitOverlay {
         }
     }
 
+    public void onBrowserEvent(Event event) {
+        final int type = DOM.eventGetType(event);
+        // cancel closing event if tooltip is mouseovered; the user might want
+        // to scroll of cut&paste
+
+        switch (type) {
+        case Event.ONMOUSEOVER:
+            closeTimer.cancel();
+            closing = false;
+            break;
+        case Event.ONMOUSEOUT:
+            hideTooltip();
+            break;
+        default:
+            // NOP
+        }
+    }
+
 }