aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Englund <marc.englund@itmill.com>2008-07-01 08:12:26 +0000
committerMarc Englund <marc.englund@itmill.com>2008-07-01 08:12:26 +0000
commit586230afd94f314ec4476b82e3da88cb38ce9211 (patch)
tree8cc3e04d03a62fd1c30c5c66bdb3e70b9ba73fbe
parent5f644265cd10f9c2aafd30eaa53e3a4cb6162877 (diff)
downloadvaadin-framework-586230afd94f314ec4476b82e3da88cb38ce9211.tar.gz
vaadin-framework-586230afd94f314ec4476b82e3da88cb38ce9211.zip
For #1859 "error messages overflow popup"; made tooltip maxwidth wider, overflow:auto, and added the possibility to mouseover the tooltip in order to scroll or cut&paste.
svn changeset:4991/svn branch:trunk
-rw-r--r--WebContent/ITMILL/themes/default/caption/caption.css3
-rw-r--r--WebContent/ITMILL/themes/default/styles.css1
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/Tooltip.java26
3 files changed, 26 insertions, 4 deletions
diff --git a/WebContent/ITMILL/themes/default/caption/caption.css b/WebContent/ITMILL/themes/default/caption/caption.css
index be808b3fc2..9ab7505c2b 100644
--- a/WebContent/ITMILL/themes/default/caption/caption.css
+++ b/WebContent/ITMILL/themes/default/caption/caption.css
@@ -35,4 +35,5 @@
padding: 7px;
background-color: #FFE0E0;
border: 1px solid #FFB0B0;
-} \ No newline at end of file
+ overflow: auto;
+}
diff --git a/WebContent/ITMILL/themes/default/styles.css b/WebContent/ITMILL/themes/default/styles.css
index be65f2a6e5..0ad6b4849f 100644
--- a/WebContent/ITMILL/themes/default/styles.css
+++ b/WebContent/ITMILL/themes/default/styles.css
@@ -99,6 +99,7 @@
padding: 7px;
background-color: #FFE0E0;
border: 1px solid #FFB0B0;
+ overflow: auto;
}
/* body tag created by servlet */
.i-generated-body {
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/Tooltip.java b/src/com/itmill/toolkit/terminal/gwt/client/Tooltip.java
index 93f6f3be79..cf1d6bd280 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/Tooltip.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/Tooltip.java
@@ -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
+ }
+ }
+
}