Bug 621779 - Cannot see more than 6 tabs when VKB is opened in portrait mode [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2011-02-10 17:13:38 +01:00
parent b548ceafd1
commit 820d8beba9
2 changed files with 26 additions and 10 deletions

View File

@ -27,7 +27,7 @@
<![CDATA[
this._container.selectedTab = this;
let selectFn = new Function("event", this._container.getAttribute("onselect"));
let selectFn = new Function("event", this._container.parentNode.getAttribute("onselect"));
selectFn.call(this);
]]>
</body>
@ -36,7 +36,7 @@
<method name="_onClose">
<body>
<![CDATA[
let callbackFunc = this._container.getAttribute(this.hasAttribute("reload") ? "onclosereloadtab" : "onclosetab");
let callbackFunc = this._container.parentNode.getAttribute(this.hasAttribute("reload") ? "onclosereloadtab" : "onclosetab");
let closeFn = new Function("event", callbackFunc);
closeFn.call(this);
]]>
@ -102,14 +102,26 @@
<binding id="tablist">
<content>
<xul:vbox class="tabs-list" anonid="tabs-children" flex="1"/>
<xul:scrollbox anonid="tabs-scrollbox" flex="1">
<xul:vbox class="tabs-list" anonid="tabs-children" />
</xul:scrollbox>
<xul:box class="tabs-list" anonid="tabs-undo"/>
</content>
<implementation>
<field name="children">document.getAnonymousElementByAttribute(this, "anonid", "tabs-children");</field>
<field name="_scrollbox">document.getAnonymousElementByAttribute(this, "anonid", "tabs-scrollbox");</field>
<field name="_tabsUndo">document.getAnonymousElementByAttribute(this, "anonid", "tabs-undo");</field>
<field name="_selectedTab">null</field>
<!-- Used by the chrome input handler -->
<property name="boxObject"
readonly="true"
onget="return this._scrollbox.boxObject;"/>
<field name="scrollBoxObject">
this.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
</field>
<field name="_closedTab">null</field>
<property name="hasClosedTab" readonly="true" onget="return !!this._closedTab;"/>
@ -188,12 +200,13 @@
<body>
<![CDATA[
let container = this.parentNode.getBoundingClientRect();
let element = this.children.getBoundingClientRect();
let element = this._scrollbox.getBoundingClientRect();
let undo = this._tabsUndo.getBoundingClientRect();
let lastChild = this.parentNode.lastChild.getBoundingClientRect();
let height = window.innerHeight - element.top - (lastChild.top - element.bottom) - lastChild.height;
this.children.style.height = height + "px";
this._scrollbox.style.height = height + "px";
this._updateWidth();
]]>
@ -214,7 +227,9 @@
// style.height rule
let columnsCount = Math.ceil(this.children.childNodes.length / Math.floor(parseInt(this.children.style.height) / (firstBox.height + 4)));
if (this._columnsCount != columnsCount && window.innerWidth > 1) { // > 1 to ignore column resizing while the main window is loading
this.children.style.width = (columnsCount * (COLUMN_MARGIN + firstBox.width)) + "px";
let width = columnsCount * (COLUMN_MARGIN + firstBox.width);
this.children.style.width = width + "px";
this._scrollbox.style.width = width + "px";
this._columnsCount = columnsCount;
}
]]>

View File

@ -877,7 +877,11 @@ autocompleteresult.noresults > .autocomplete-item-container {
-moz-box-align: start;
}
#tabs > .tabs-list {
#tabs > scrollbox {
max-width: 350px;
}
#tabs .tabs-list {
display: block;
-moz-column-width: 121px;
-moz-column-gap: 0;
@ -895,10 +899,6 @@ autocompleteresult.noresults > .autocomplete-item-container {
}
documenttab {
/* display:block allow us to change the line-height, it won't work otherwise */
display: block;
line-height: 0;
-moz-margin-start: @margin_xnormal@;
margin-bottom: @documenttab_margin_bottom@;
width: 121px;
@ -909,6 +909,7 @@ documenttab {
background-clip: padding-box;
border: @border_width_tiny@ solid rgba(0,0,0,0.1);
border-bottom-width: @border_width_small@;
line-height: 0;
}
documenttab[selected="true"] {