Bug 351965: Disable background close looks evil in the new themes, patch by Phil Ringnalda <philringnalda@gmail.com>, r=mano

This commit is contained in:
gavin%gavinsharp.com 2006-09-12 22:41:31 +00:00
Родитель 0b0b05842a
Коммит 3c1a851528
6 изменённых файлов: 7 добавлений и 60 удалений

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

@ -261,7 +261,13 @@ pref("browser.tabs.loadDivertedInBackground", false);
pref("browser.tabs.loadBookmarksInBackground", false);
pref("browser.tabs.tabMinWidth", 100);
pref("browser.tabs.tabClipWidth", 140);
pref("browser.tabs.disableBackgroundClose", false);
// Where to show tab close buttons:
// 0 on active tab only
// 1 on all tabs until tabClipWidth is reached, then active tab only
// 2 no close buttons at all
// 3 at the end of the tabstrip
pref("browser.tabs.closeButtons", 1);
// When tabs opened by links in other tabs via a combination of
// browser.link.open_newwindow being set to 3 and target="_blank" etc are

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

@ -2548,11 +2548,8 @@
}
this.firstChild.minWidth = this.mTabMinWidth;
this._updateDisableBackgroundClose();
this.adjustTabstrip();
pb2.addObserver("browser.tabs.disableBackgroundClose",
this._prefObserver, true);
pb2.addObserver("browser.tabs.closeButtons",
this._prefObserver, true);
@ -2602,23 +2599,6 @@
document.getAnonymousElementByAttribute(this, "anonid", "tabstrip-closebutton");
</field>
<method name="_updateDisableBackgroundClose">
<body><![CDATA[
var prefs =
Components.classes['@mozilla.org/preferences-service;1'].
getService(Components.interfaces.nsIPrefBranch);
try {
if (prefs.getBoolPref("browser.tabs.disableBackgroundClose"))
this.setAttribute("disablebackgroundclose", "true");
else
this.removeAttribute("disablebackgroundclose");
}
catch (e) {
this.setAttribute("disablebackgroundclose", "true");
}
]]></body>
</method>
<field name="_prefObserver">({
tabbox: this,
@ -2626,9 +2606,6 @@
{
if (topic == "nsPref:changed") {
switch (data) {
case "browser.tabs.disableBackgroundClose":
this.tabbox._updateDisableBackgroundClose();
break;
case "browser.tabs.closeButtons":
var pb2 =
Components.classes['@mozilla.org/preferences-service;1'].
@ -3013,7 +2990,6 @@
<xul:image class="tab-icon" xbl:inherits="validate,src=image"/>
<xul:label class="tab-text" xbl:inherits="value=label,accesskey,crop,disabled" flex="1"/>
</xul:hbox>
<xul:image anonid="close-button-placeholder" class="tab-close-button-placeholder"/>
<xul:toolbarbutton anonid="close-button" tabindex="-1" class="tab-close-button"/>
</content>

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

@ -640,18 +640,6 @@ tab {
display: -moz-box;
}
.tab-close-button-placeholder {
display: none;
}
.tabbrowser-tabs[disablebackgroundclose="true"] > .tabbrowser-tab:not([selected="true"]) > .tab-close-button {
display: none;
}
.tabbrowser-tabs[disablebackgroundclose="true"]:not([closebuttons="noclose"]):not([closebuttons="closeatend"]) > .tabbrowser-tab:not([selected="true"]) .tab-close-button-placeholder {
display: -moz-box;
}
tabpanels {
-moz-binding: url("chrome://global/content/bindings/tabbox.xml#tabpanels");
display: -moz-deck;

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

@ -231,16 +231,6 @@ tabbrowser > tabbox > tabpanels {
-moz-user-focus: normal;
}
.tab-close-button-placeholder {
list-style-image: url("chrome://global/skin/icons/closetab.png");
opacity: 0.5;
-moz-margin-start: -5px;
-moz-padding-end: 3px;
margin-top: 2px;
border: none !important;
padding: 0px;
}
/**
* All Tabs Button
*/

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

@ -16,9 +16,6 @@
<content chromedir="&locale.dir;"
closetabtext="&closeTab.label;">
<xul:hbox class="tab-image-left" xbl:inherits="selected"/>
<xul:hbox pack="center" align="center">
<xul:image anonid="close-button-placeholder" class="tab-close-button-placeholder"/>
</xul:hbox>
<xul:toolbarbutton anonid="close-button" class="tab-close-button" tabindex="-1"/>
<xul:hbox flex="1" class="tab-image-middle" align="center" xbl:inherits="selected">
<xul:stack class="tab-icon">

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

@ -96,16 +96,6 @@ tab {
opacity: 1.0;
}
.tab-close-button-placeholder {
list-style-image: url("chrome://global/skin/icons/close.png");
-moz-image-region: rect(0px, 64px, 16px, 48px);
opacity: 0.7;
-moz-margin-start: 2px;
margin-top: 2px;
border: none !important;
padding: 0px;
}
.tabbrowser-tab[selected="true"] > .tab-close-button {
-moz-margin-start: 2px;
margin-top: 0px;