Putting toolbar grippies back in. Bug 175091.

Original bug for removing them was 112534.
Please see the discussion in those 2 bugs before complaining or filling new bug reports!
r=caillon,a=UE team
This commit is contained in:
varga%netscape.com 2003-01-18 20:55:19 +00:00
Родитель 4f9805653f
Коммит cf7d4f59f9
16 изменённых файлов: 499 добавлений и 9 удалений

Просмотреть файл

@ -64,6 +64,10 @@ panel[disabled="true"] > .viewer-pane-box-1 {
border-right: none;
}
.viewer-pane-header > toolbargrippy {
display: none;
}
.viewer-pane-header > .toolbar-holder {
border-bottom: none;
}
@ -82,3 +86,7 @@ panel[disabled="true"] > .viewer-pane-box-1 {
border-bottom: none;
}
.viewer-pane-header > toolbargrippy {
display: none;
}

Просмотреть файл

@ -60,6 +60,10 @@ domi-panel[disabled="true"] > .viewer-pane-box-1 {
display: none;
}
.viewer-pane-header > toolbargrippy {
display: none;
}
.viewer-pane-toolbox {
border-top: none;
border-bottom: none;

Просмотреть файл

@ -2937,6 +2937,15 @@ function GetMsgHeadersToolbarElement()
return gMsgHeadersToolbarElement;
}
function IsMsgHeadersToolbarCollapsed()
{
var element = GetMsgHeadersToolbarElement();
if(element)
return(element.getAttribute('moz-collapsed') == "true");
return(0);
}
function WhichElementHasFocus()
{
var msgIdentityElement = GetMsgIdentityElement();
@ -2978,7 +2987,9 @@ function SwitchElementFocus(event)
if (event && event.shiftKey)
{
if (focusedElement == gMsgAddressingWidgetTreeElement)
if (IsMsgHeadersToolbarCollapsed())
SetMsgBodyFrameFocus();
else if (focusedElement == gMsgAddressingWidgetTreeElement)
SetMsgIdentityElementFocus();
else if (focusedElement == gMsgIdentityElement)
SetMsgBodyFrameFocus();
@ -2998,7 +3009,9 @@ function SwitchElementFocus(event)
}
else
{
if (focusedElement == gMsgAddressingWidgetTreeElement)
if (IsMsgHeadersToolbarCollapsed())
SetMsgBodyFrameFocus();
else if (focusedElement == gMsgAddressingWidgetTreeElement)
SetMsgSubjectElementFocus();
else if (focusedElement == gMsgSubjectElement)
{

Просмотреть файл

@ -46,6 +46,10 @@ toolbar#toolbox button.tool {
color: inherit;
}
toolbar.toolbox > toolbargrippy {
visibility: collapse;
}
#pointerButton {
list-style-image:url("chrome://editor/skin/images/Map_pointerTool.gif");
}

Просмотреть файл

@ -54,6 +54,55 @@ menubar {
border-bottom: 1px solid ThreeDShadow;
}
/* ::::: toolbargrippy ::::: */
toolbargrippy {
-moz-box-orient: vertical;
-moz-box-align: center;
border-left: 1px solid ThreeDHighlight;
border-top: 1px solid ThreeDHighlight;
border-right: 1px solid ThreeDShadow;
border-bottom: 1px solid ThreeDShadow;
width: 10px;
padding: 2px 1px;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow.gif");
}
toolbargrippy:hover {
background-color: #CCCCFF;
}
.toolbargrippy-texture {
margin-top: 2px;
width: 6px;
background: url("chrome://global/skin/toolbar/tbgrip-texture.gif");
}
/* ::::: collapsed tray and grippies ::::: */
toolbargrippy[tbgrippy-collapsed="true"] {
-moz-box-orient: horizontal;
border-left: 1px solid ThreeDHighlight;
border-top: 1px solid ThreeDHighlight;
border-right: 1px solid ThreeDShadow;
border-bottom: 1px solid ThreeDShadow;
width: 40px;
height: 10px;
padding: 1px 2px;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow-clps.gif");
}
toolbargrippy[tbgrippy-collapsed="true"] > .toolbargrippy-texture {
margin-top: 0;
margin-left: 2px;
width: 0px;
height: 6px;
}
.collapsed-tray-spacer {
border-bottom: 1px solid ThreeDShadow;
}
/* ::::: toolbarseparator ::::: */
toolbarseparator {

Просмотреть файл

@ -52,6 +52,55 @@ menubar {
border-bottom: 1px solid ThreeDShadow;
}
/* ::::: toolbargrippy ::::: */
toolbargrippy {
-moz-box-orient: vertical;
-moz-box-align: center;
border-left: 1px solid ThreeDHighlight;
border-top: 1px solid ThreeDHighlight;
border-right: 1px solid ThreeDShadow;
border-bottom: 1px solid ThreeDShadow;
width: 10px;
padding: 2px 1px;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow.gif");
}
toolbargrippy:hover {
background-color: #CCCCFF;
}
.toolbargrippy-texture {
margin-top: 2px;
width: 6px;
background: url("chrome://global/skin/toolbar/tbgrip-texture.gif");
}
/* ::::: collapsed tray and grippies ::::: */
toolbargrippy[tbgrippy-collapsed="true"] {
-moz-box-orient: horizontal;
border-left: 1px solid ThreeDHighlight;
border-top: 1px solid ThreeDHighlight;
border-right: 1px solid ThreeDShadow;
border-bottom: 1px solid ThreeDShadow;
width: 40px;
height: 10px;
padding: 1px 2px;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow-clps.gif");
}
toolbargrippy[tbgrippy-collapsed="true"] > .toolbargrippy-texture {
margin-top: 0;
margin-left: 2px;
width: 0px;
height: 6px;
}
.collapsed-tray-spacer {
border-bottom: 1px solid ThreeDShadow;
}
/* ::::: toolbarseparator ::::: */
toolbarseparator {

Просмотреть файл

@ -73,6 +73,37 @@
display: none;
}
/* ::::: toolbargrippy ::::: */
.toolbar-primary-grippy {
-moz-binding: url("chrome://communicator/skin/toolbar/toolbarBindings.xml#toolbargrippy-primary");
border: none;
background: url("chrome://communicator/skin/toolbar/prtb-grip-mid.gif") repeat-y;
list-style-image: url("chrome://communicator/skin/toolbar/prtb-grip-btm.gif");
}
.toolbar-primary-grippy > .toolbargrippy-texture {
width: 13px;
height: 0px;
list-style-image: url("chrome://communicator/skin/toolbar/prtb-grip-top.gif");
}
.toolbar-primary-grippy > .toolbargrippy-arrow {
margin: 0px;
width: 13px;
height: 10px;
list-style-image: inherit;
}
.toolbar-primary-grippy:hover:active {
background-image: url("chrome://communicator/skin/toolbar/prtb-grip-mid-act.gif");
list-style-image: url("chrome://communicator/skin/toolbar/prtb-grip-btm-act.gif");
}
.toolbar-primary-grippy:hover:active > .toolbargrippy-texture {
list-style-image: url("chrome://communicator/skin/toolbar/prtb-grip-top-act.gif");
}
/* ::::: toolbar-primary separator ::::: */
.toolbarseparator-primary {

Просмотреть файл

@ -8,6 +8,8 @@
<binding id="toolbar-primary"
extends="chrome://global/content/bindings/toolbar.xml#toolbar-primary">
<content>
<xul:toolbargrippy xbl:inherits="last-toolbar"
tbattr="toolbar-grippy" class="toolbar-primary-grippy"/>
<xul:hbox class="toolbar-holder toolbar-primary-holder" flex="1" xbl:inherits="orient=tborient,buttonstyle">
<xul:image class="toolbar-primary-icon" xbl:inherits="buttonstyle"/>
<xul:hbox class="toolbar-button-box" flex="1">
@ -17,4 +19,12 @@
</content>
</binding>
<binding id="toolbargrippy-primary"
extends="chrome://global/content/bindings/toolbar.xml#toolbargrippy">
<content>
<xul:image class="toolbargrippy-arrow"/>
<xul:image class="toolbargrippy-texture" flex="1"/>
</content>
</binding>
</bindings>

Просмотреть файл

@ -43,6 +43,7 @@
background: url("chrome://global/skin/toolbar/tb-mid.gif") #C7D0D9 repeat-x top;
}
#FormatToolbar > toolbargrippy,
#FormatToolbar > .toolbar-holder {
border-top: 1px solid #CED6DD;
border-right: 1px solid #95A0AD;
@ -50,6 +51,10 @@
border-left: 1px solid #DAE3ED;
}
#FormatToolbar > toolbargrippy:hover:active {
border-color: #67737E;
}
/* ::::: formatting buttons ::::: */
#FormatToolbar > toolbarbutton {

Просмотреть файл

@ -80,6 +80,67 @@ menubar > .toolbar-holder {
border-left: 1px solid #EEF4FC;
}
/* ::::: toolbargrippy ::::: */
toolbargrippy {
-moz-box-orient: vertical;
-moz-box-align: center;
-moz-box-pack: end;
-moz-box-direction: reverse;
border-top: 1px solid #EEF0F3;
border-right: 1px solid #86929E;
border-bottom: 1px solid #86929E;
border-left: 1px solid #EEF0F3;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow.gif");
}
toolbargrippy:hover:active {
border-color: #67737E;
background-color: #9DA9B6;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow-act.gif");
}
.toolbargrippy-arrow {
margin: 0px 1px 3px 1px;
width: 8px;
height: 5px;
}
/* ::::: menubar grippy ::::: */
menubar > toolbargrippy {
border-top: 1px solid #EBF4FF;
border-right: 1px solid #B9BFC7;
border-bottom: 1px solid #B9BFC7;
border-left: 1px solid #F4FAFF;
background-color: #DDE3EB;
list-style-image: url("chrome://global/skin/toolbar/mbgrip-arrow.gif");
}
/* ::::: collapsed toolbargrippy and tray ::::: */
toolbargrippy[tbgrippy-collapsed="true"] {
-moz-box-orient: horizontal;
-moz-box-pack: start;
-moz-box-direction: normal;
width: 40px;
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow-clps.gif");
}
toolbargrippy[tbgrippy-collapsed="true"] > .toolbargrippy-arrow {
margin: 1px 0px 1px 3px;
width: 5px;
height: 8px;
}
toolbargrippy[tbgrippy-collapsed="true"]:hover:active > .toolbargrippy-arrow {
list-style-image: url("chrome://global/skin/toolbar/tbgrip-arrow-clps-act.gif");
}
.collapsed-tray-holder {
background-color: #C7D0D9;
}
/* ::::: toolbarseparator ::::: */
toolbarseparator {

Просмотреть файл

@ -148,7 +148,9 @@
background: url("chrome://global/skin/toolbar/tb-mid.gif") #C7D0D9 repeat-x top;
}
#MsgHeadersToolbar > toolbargrippy,
#MsgHeadersToolbar > .toolbar-holder,
#FormatToolbar > toolbargrippy,
#FormatToolbar > .toolbar-holder {
border-top: 1px solid #CED6DD;
border-right: 1px solid #95A0AD;
@ -156,6 +158,11 @@
border-left: 1px solid #DAE3ED;
}
#MsgHeadersToolbar > toolbargrippy:hover:active,
#FormatToolbar > toolbargrippy:hover:active {
border-color: #67737E;
}
.toolbox-top {
border-bottom: none;
}

Просмотреть файл

@ -248,6 +248,10 @@
-moz-box-align: center;
}
#nav-bar[toolbarmode="small"] > .toolbar-primary-grippy {
display: none;
}
#nav-bar[toolbarmode="small"] > .toolbar-primary-holder {
background: #D0D7DF;
}
@ -468,6 +472,7 @@
background: url("chrome://global/skin/toolbar/tb-mid.gif") #C7D0D9 repeat-x top;
}
#PersonalToolbar > toolbargrippy,
#PersonalToolbar > .toolbar-holder {
border-top: 1px solid #CED6DD;
border-right: 1px solid #95A0AD;
@ -475,6 +480,10 @@
border-left: 1px solid #DAE3ED;
}
#PersonalToolbar > toolbargrippy:hover:active {
border-color: #67737E;
}
#home-button {
list-style-image: url("chrome://communicator/skin/bookmarks/home.gif");
}

Просмотреть файл

@ -124,9 +124,9 @@ Contributor(s):
<toolbox id="navigator-toolbox" class="toolbox-top" deferattached="true">
<!-- Menu -->
<menubar id="main-menubar" grippytooltiptext="&menuBar.tooltip;"/>
<menubar id="main-menubar" persist="collapsed" grippytooltiptext="&menuBar.tooltip;"/>
<toolbar class="toolbar-primary chromeclass-toolbar" id="nav-bar"
<toolbar class="toolbar-primary chromeclass-toolbar" id="nav-bar" persist="collapsed"
grippytooltiptext="&navigationToolbar.tooltip;"
tbalign="stretch" fullscreentoolbar="true">
<hbox id="nav-bar-buttons">
@ -237,7 +237,7 @@ Contributor(s):
</hbox>
</toolbar>
<toolbar id="PersonalToolbar" class="chromeclass-directories"
<toolbar id="PersonalToolbar" class="chromeclass-directories" persist="collapsed"
grippytooltiptext="&personalToolbar.tooltip;" tbalign="stretch"
ondraggesture="nsDragAndDrop.startDrag(event, personalToolbarDNDObserver)"
ondragdrop="nsDragAndDrop.drop(event, personalToolbarDNDObserver); event.preventBubble()"

Просмотреть файл

@ -24,13 +24,158 @@
</implementation>
</binding>
<binding id="toolbox" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
<content orient="vertical">
<xul:vbox flex="1" class="toolbar-internal-box">
<children/>
</xul:vbox>
<xul:hbox tbattr="collapsed-tray-holder" class="collapsed-tray-holder" moz-collapsed="true">
<xul:hbox tbattr="collapsed-tray" class="collapsed-tray"/>
<xul:spacer flex="1" class="collapsed-tray-spacer"/>
</xul:hbox>
</content>
<implementation>
<method name="collapseToolbar">
<parameter name="toolbar"/>
<body>
<![CDATA[
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
try {
this.createCollapsedGrippy(toolbar);
toolbar.setAttribute("moz-collapsed", "true");
document.persist(toolbar.id, "moz-collapsed");
}
catch(e) {
}
]]>
</body>
</method>
<method name="expandToolbar">
<parameter name="aGrippyID"/>
<body>
<![CDATA[
var idString = aGrippyID.substring("moz_tb_collapsed_".length, aGrippyID.length);
var toolbar = document.getElementById(idString);
toolbar.setAttribute("moz-collapsed", "false");
var collapsedTray = this.findNodeByAttribute("tbattr", "collapsed-tray");
var collapsedToolbar = document.getElementById("moz_tb_collapsed_" + toolbar.id);
collapsedTray.removeChild(collapsedToolbar);
if (!collapsedTray.hasChildNodes())
this.findNodeByAttribute("tbattr", "collapsed-tray-holder").setAttribute("moz-collapsed", "true");
document.persist(toolbar.id, "moz-collapsed");
]]>
</body>
</method>
<method name="findNodeByAttribute">
<parameter name="aAttribute"/>
<parameter name="aValue"/>
<body>
<![CDATA[
var nodes = document.getAnonymousNodes(this);
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].getAttribute(aAttribute) == aValue)
return nodes[i];
else {
var subnodes = nodes[i].getElementsByAttribute(aAttribute, aValue);
if (!subnodes.length) continue;
return subnodes[0];
}
}
return null;
]]>
</body>
</method>
<method name="createCollapsedGrippy">
<parameter name="aToolbar"/>
<body>
<![CDATA[
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
try {
var grippy = aToolbar.findNodeByAttribute("tbattr", "toolbar-grippy");
var boxObject = grippy.boxObject.QueryInterface(Components.interfaces.nsIBoxObject);
var collapsedGrippy = document.createElementNS(XUL_NS, "toolbargrippy");
if (collapsedGrippy) {
var width = boxObject.height > 20 ? boxObject.height : 23;
var height = boxObject.width > 10 ? boxObject.width : 12;
var styleString = "width: " + width + "px; height: " + height + "px;";
collapsedGrippy.setAttribute("style", styleString);
collapsedGrippy.setAttribute("tooltiptext", aToolbar.getAttribute("grippytooltiptext"));
collapsedGrippy.setAttribute("id", "moz_tb_collapsed_" + aToolbar.id);
collapsedGrippy.setAttribute("moz_grippy_collapsed", "true");
collapsedGrippy.setAttribute("tbgrippy-collapsed", "true");
var collapsedTrayHolder = this.findNodeByAttribute("tbattr", "collapsed-tray-holder");
if (collapsedTrayHolder.getAttribute("moz-collapsed") == "true")
collapsedTrayHolder.removeAttribute("moz-collapsed");
this.findNodeByAttribute("tbattr", "collapsed-tray").appendChild(collapsedGrippy);
collapsedGrippy = document.getElementById("moz_tb_collapsed_" + aToolbar.id);
}
}
catch (e) {
throw e;
}
]]>
</body>
</method>
<property name="deferAttached">
<getter>
return (this.hasAttribute("deferattached") ? "true" : "false");
</getter>
<setter>
if (val)
this.setAttribute("deferattached", "true");
else
this.removeAttribute("deferattached");
return val;
</setter>
</property>
</implementation>
</binding>
<binding id="toolbar" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
<content>
<xul:toolbargrippy xbl:inherits="last-toolbar,hidden=grippyhidden"
tbattr="toolbar-grippy"
class="toolbar-grippy"/>
<xul:hbox flex="1" class="toolbar-holder" align="center"
xbl:inherits="collapsed,last-toolbar,orient=tborient,align=tbalign,pack=tbpack">
<children/>
</xul:hbox>
</content>
<implementation>
<constructor>
<![CDATA[
if (this.getAttribute("moz-collapsed") == "true" &&
this.parentNode.localName == "toolbox")
this.parentNode.createCollapsedGrippy(this);
]]>
</constructor>
<method name="findNodeByAttribute">
<parameter name="aAttribute"/>
<parameter name="aValue"/>
<body>
<![CDATA[
var nodes = document.getAnonymousNodes(this);
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].getAttribute(aAttribute) == aValue)
return nodes[i];
else {
var subnodes = nodes[i].getElementsByAttribute(aAttribute, aValue);
return subnodes.length ? subnodes[0] : null;
}
}
return null;
]]>
</body>
</method>
</implementation>
</binding>
<binding id="toolbar-primary" extends="chrome://global/content/bindings/toolbar.xml#toolbar">
@ -92,6 +237,8 @@
</resources>
<content>
<xul:toolbargrippy xbl:inherits="last-toolbar,hidden=grippyhidden"
tbattr="toolbar-grippy" class="toolbar-grippy"/>
<xul:hbox flex="1" class="toolbar-holder" xbl:inherits="collapsed,last-toolbar" align="center">
<children/>
</xul:hbox>
@ -106,9 +253,95 @@
]]>
</getter>
</property>
<constructor>
<![CDATA[
if (this.getAttribute("moz-collapsed") == "true" &&
this.parentNode.localName == "toolbox")
this.parentNode.createCollapsedGrippy(this);
]]>
</constructor>
<method name="findNodeByAttribute">
<parameter name="aAttribute"/>
<parameter name="aValue"/>
<body>
<![CDATA[
var nodes = document.getAnonymousNodes(this);
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].getAttribute(aAttribute) == aValue)
return nodes[i];
else {
var subnodes = nodes[i].getElementsByAttribute(aAttribute, aValue);
return subnodes.length ? subnodes[0] : null;
}
}
return null;
]]>
</body>
</method>
</implementation>
</binding>
<binding id="toolbargrippy" display="xul:button"
extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
<content>
<xul:image class="toolbargrippy-arrow"/>
<xul:spacer class="toolbargrippy-texture" flex="1"/>
</content>
<implementation>
<property name="collapsed">
<getter>
return this.hasAttribute("moz_grippy_collapsed");
</getter>
<setter>
if (val)
this.setAttribute("moz_grippy_collapsed", "true");
else
this.removeAttribute("moz_grippy_collapsed");
return val;
</setter>
</property>
<method name="returnNode">
<parameter name="aNodeA"/>
<parameter name="aNodeB"/>
<body>
<![CDATA[
var node = this.parentNode;
while (node && node.localName != "window" &&
(node.localName != aNodeA && (node.localName != aNodeB))) {
node = node.parentNode;
}
return node;
]]>
</body>
</method>
<method name="grippyTriggered">
<body>
<![CDATA[
var toolbox = this.returnNode("toolbox");
var toolbar = this.returnNode("toolbar", "menubar");
if (this.collapsed)
toolbox.expandToolbar(this.id);
else
toolbox.collapseToolbar(toolbar);
]]>
</body>
</method>
</implementation>
<handlers>
<handler event="command">
<![CDATA[
this.grippyTriggered();
]]>
</handler>
</handlers>
</binding>
<binding id="toolbarseparator" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base"/>
</bindings>

Просмотреть файл

@ -57,10 +57,12 @@ var FullScreen =
if (els[i].getAttribute("fullscreentoolbar") == "true") {
this.setToolbarButtonMode(els[i], aShow ? "" : "small");
} else {
// use moz-collapsed so it doesn't persist hidden/collapsed,
// so that new windows don't have missing toolbars
if (aShow)
els[i].removeAttribute("collapsed");
els[i].removeAttribute("moz-collapsed");
else
els[i].setAttribute("collapsed", "true");
els[i].setAttribute("moz-collapsed", "true");
}
}

Просмотреть файл

@ -23,7 +23,8 @@
}
/* hide the content, but don't destroy the frames */
*[collapsed="true"] {
*[collapsed="true"],
*[moz-collapsed="true"] {
visibility: collapse;
}
@ -207,7 +208,7 @@ caption {
/******* toolbar *******/
toolbox {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-base");
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbox");
-moz-box-orient: vertical;
}
@ -215,6 +216,10 @@ toolbar {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar");
}
toolbargrippy {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbargrippy");
}
toolbarseparator {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbarseparator");
}