зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
0b0b05842a
Коммит
3c1a851528
|
@ -261,7 +261,13 @@ pref("browser.tabs.loadDivertedInBackground", false);
|
||||||
pref("browser.tabs.loadBookmarksInBackground", false);
|
pref("browser.tabs.loadBookmarksInBackground", false);
|
||||||
pref("browser.tabs.tabMinWidth", 100);
|
pref("browser.tabs.tabMinWidth", 100);
|
||||||
pref("browser.tabs.tabClipWidth", 140);
|
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
|
// 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
|
// browser.link.open_newwindow being set to 3 and target="_blank" etc are
|
||||||
|
|
|
@ -2548,11 +2548,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.firstChild.minWidth = this.mTabMinWidth;
|
this.firstChild.minWidth = this.mTabMinWidth;
|
||||||
this._updateDisableBackgroundClose();
|
|
||||||
this.adjustTabstrip();
|
this.adjustTabstrip();
|
||||||
|
|
||||||
pb2.addObserver("browser.tabs.disableBackgroundClose",
|
|
||||||
this._prefObserver, true);
|
|
||||||
pb2.addObserver("browser.tabs.closeButtons",
|
pb2.addObserver("browser.tabs.closeButtons",
|
||||||
this._prefObserver, true);
|
this._prefObserver, true);
|
||||||
|
|
||||||
|
@ -2602,23 +2599,6 @@
|
||||||
document.getAnonymousElementByAttribute(this, "anonid", "tabstrip-closebutton");
|
document.getAnonymousElementByAttribute(this, "anonid", "tabstrip-closebutton");
|
||||||
</field>
|
</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">({
|
<field name="_prefObserver">({
|
||||||
tabbox: this,
|
tabbox: this,
|
||||||
|
|
||||||
|
@ -2626,9 +2606,6 @@
|
||||||
{
|
{
|
||||||
if (topic == "nsPref:changed") {
|
if (topic == "nsPref:changed") {
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case "browser.tabs.disableBackgroundClose":
|
|
||||||
this.tabbox._updateDisableBackgroundClose();
|
|
||||||
break;
|
|
||||||
case "browser.tabs.closeButtons":
|
case "browser.tabs.closeButtons":
|
||||||
var pb2 =
|
var pb2 =
|
||||||
Components.classes['@mozilla.org/preferences-service;1'].
|
Components.classes['@mozilla.org/preferences-service;1'].
|
||||||
|
@ -3013,7 +2990,6 @@
|
||||||
<xul:image class="tab-icon" xbl:inherits="validate,src=image"/>
|
<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:label class="tab-text" xbl:inherits="value=label,accesskey,crop,disabled" flex="1"/>
|
||||||
</xul:hbox>
|
</xul:hbox>
|
||||||
<xul:image anonid="close-button-placeholder" class="tab-close-button-placeholder"/>
|
|
||||||
<xul:toolbarbutton anonid="close-button" tabindex="-1" class="tab-close-button"/>
|
<xul:toolbarbutton anonid="close-button" tabindex="-1" class="tab-close-button"/>
|
||||||
</content>
|
</content>
|
||||||
|
|
||||||
|
|
|
@ -640,18 +640,6 @@ tab {
|
||||||
display: -moz-box;
|
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 {
|
tabpanels {
|
||||||
-moz-binding: url("chrome://global/content/bindings/tabbox.xml#tabpanels");
|
-moz-binding: url("chrome://global/content/bindings/tabbox.xml#tabpanels");
|
||||||
display: -moz-deck;
|
display: -moz-deck;
|
||||||
|
|
|
@ -231,16 +231,6 @@ tabbrowser > tabbox > tabpanels {
|
||||||
-moz-user-focus: normal;
|
-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
|
* All Tabs Button
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,9 +16,6 @@
|
||||||
<content chromedir="&locale.dir;"
|
<content chromedir="&locale.dir;"
|
||||||
closetabtext="&closeTab.label;">
|
closetabtext="&closeTab.label;">
|
||||||
<xul:hbox class="tab-image-left" xbl:inherits="selected"/>
|
<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:toolbarbutton anonid="close-button" class="tab-close-button" tabindex="-1"/>
|
||||||
<xul:hbox flex="1" class="tab-image-middle" align="center" xbl:inherits="selected">
|
<xul:hbox flex="1" class="tab-image-middle" align="center" xbl:inherits="selected">
|
||||||
<xul:stack class="tab-icon">
|
<xul:stack class="tab-icon">
|
||||||
|
|
|
@ -96,16 +96,6 @@ tab {
|
||||||
opacity: 1.0;
|
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 {
|
.tabbrowser-tab[selected="true"] > .tab-close-button {
|
||||||
-moz-margin-start: 2px;
|
-moz-margin-start: 2px;
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче