tooltip infrastructure

This commit is contained in:
ben%netscape.com 2000-05-04 04:30:53 +00:00
parent 6af30c5a92
commit 6dbe1821e5
5 changed files with 27 additions and 12 deletions

View File

@ -355,11 +355,11 @@ function SendPage()
function FillInTooltip ( tipElement )
{
var retVal = false;
var button = document.getElementById('replaceMe');
if ( button ) {
var tipText = tipElement.getAttribute('tooltiptext');
var textNode = document.getElementById("TOOLTIP_tooltipText");
if ( textNode ) {
var tipText = tipElement.getAttribute("tooltiptext");
if ( tipText != "" ) {
button.setAttribute('value', tipText);
textNode.setAttribute('value', tipText);
retVal = true;
}
}

View File

@ -161,12 +161,9 @@
</box>
<popupset id="aTooltipSet">
<popup id="aTooltip"
oncreate="return FillInTooltip(document.tooltipNode);"
style="border: thin solid black;">
<titledbutton id="replaceMe" align="left" crop="right" class="borderless"
value="Empty Tooltip" />
</popup>
<popup id="aTooltip" class="tooltip" oncreate="return FillInTooltip(document.tooltipNode);" >
<text id="TOOLTIP_tooltipText"/>
</popup>
</popupset>
</overlay>

View File

@ -167,3 +167,19 @@ menuitem[checked="true"][menuactive="true"]
{
list-style-image : url("chrome://global/skin/menu-arrow-hover.gif");
}
/** Tooltips (tooltip <popup> element)
* class="tooltip"
**/
.tooltip
{
background-color : #FFFFCC;
border : 1px outset #FFFFCC;
color : #000000;
font : smaller;
padding : 3px;
}

View File

@ -80,7 +80,8 @@
<binding id="menubutton-dual">
<content excludes="template,observes,menupopup">
<xul:box class="menubutton-internal-box">
<xul:button class="menubutton-dual-button" allowevents="true" inherits="buttonaction:oncommand,src,value,crop,accesskey"/>
<xul:button class="menubutton-dual-button" allowevents="true"
inherits="buttontooltiptext:tooltiptext,buttonaction:oncommand,src,value,crop,accesskey"/>
<xul:image class="menubutton-dropmarker"/>
</xul:box>
</content>

View File

@ -463,7 +463,8 @@
<binding id="toolbar">
<content>
<xul:toolbargrippy onclick="var v = parentNode;
<xul:toolbargrippy inherits="grippytooltiptext:tooltiptext"
onclick="var v = parentNode;
var attr = v.getAttribute('collapsed');
if (attr == 'true') {
v.removeAttribute('collapsed');