structure toolbar unusable when depth is high; b=358742; r=ajvincent

This commit is contained in:
daniel%glazman.org 2006-10-30 15:31:28 +00:00
parent 0b632217bb
commit 28f21d8213
3 changed files with 52 additions and 13 deletions

View File

@ -38,10 +38,41 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
structurebar {
-moz-box-orient: horizontal;
-moz-binding: url("chrome://composer/content/bindings/structurebar.xml#structurebar");
overflow: -moz-hidden-unscrollable;
min-width: 1px;
-moz-box-pack: end;
}
toolbarbutton {
padding: 0px;
}
autorepeatbutton {
-moz-border-radius: 3px;
width: 1.5em;
}
.autorepeatbutton-up {
margin-right: 1em;
}
.autorepeatbutton-down {
margin-left: 1em;
}
autorepeatbutton:not([disabled]) {
background-color: #e0e0e0;
}
autorepeatbutton[disabled]:hover,
autorepeatbutton[disabled]:hover:active {
-moz-box-align: center;
-moz-box-pack: center;
margin-top: 1px;
margin-bottom: 2px;
-moz-margin-start: 1px;
-moz-margin-end: 2px;
border: 1px solid transparent;
padding: 1px;
}

View File

@ -48,7 +48,7 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="structurebar">
<binding id="structurebar" extends="chrome://global/content/bindings/scrollbox.xml#arrowscrollbox">
<resources>
<stylesheet src="chrome://composer/skin/structurebar.css"/>
@ -65,10 +65,11 @@
<body>
<![CDATA[
var node = aNode;
var toolbarbutton;
if (this.mLastNode == node)
{
// avoid rebuilding the whole structure toolbar if possible
var toolbarbutton = this.lastChild;
toolbarbutton = this.lastChild;
while (node && toolbarbutton &&
node == toolbarbutton.getUserData("node") &&
node.nodeName.toLowerCase() != "html")
@ -77,20 +78,21 @@
toolbarbutton = toolbarbutton.previousSibling;
}
// so we rebuild from toolbarbutton up to the root
while (toolbarbutton)
{
var tmp = toolbarbutton.previousSibling;
this.removeChild(toolbarbutton);
toolbarbutton = tmp;
}
}
else
{
// the deepest node is not the one the toolbar is currently showing,
// so let's clear all
this.mLastNode = node;
while (this.hasChildNodes())
this.removeChild(this.lastChild);
toolbarbutton = this.lastChild;
}
while (toolbarbutton)
{
var tmp = toolbarbutton.previousSibling;
if (toolbarbutton.localName == "toolbarbutton")
this.removeChild(toolbarbutton);
toolbarbutton = tmp;
}
while (node.nodeName.toLowerCase() != "html")
@ -113,6 +115,12 @@
node = node.parentNode;
}
// make sure the deepest element is visible;
// we always have a lastChild here
var lastButton = this.lastChild.previousSibling;
if (lastButton)
this.ensureElementIsVisible(lastButton);
]]>
</body>
</method>

View File

@ -102,8 +102,8 @@
</splitter>
<vbox flex="1">
<tabeditor id="tabeditor" flex="1" visibility="hidden"/>
<structurebar id="structurebar">
<label value="structure"/>
<structurebar id="structurebar" orient="horizontal">
<spacer id="structbarflexer" flex="1"/>
</structurebar>
</vbox>
<splitter id="splitter2" collapse="after" resizeafter="closest">