Bug 1429385 - Rename adjustTabstrip to _updateCloseButtons (following M-C bug 1415235). r=jorgk

Port of bug 1415235

--HG--
extra : rebase_source : 3657ce87f4309f0d9512dbf3701fab202ca9b05f
This commit is contained in:
Richard Marti 2018-01-07 14:19:49 +01:00
Родитель 0fb99b24f9
Коммит a25cd01029
3 изменённых файлов: 15 добавлений и 15 удалений

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

@ -699,7 +699,7 @@
} else if (!this._windowIsClosing) { } else if (!this._windowIsClosing) {
// see notes in addTab // see notes in addTab
let _delayedUpdate = function (aTabContainer) { let _delayedUpdate = function (aTabContainer) {
aTabContainer.adjustTabstrip(); aTabContainer._updateCloseButtons();
aTabContainer.mTabstrip._updateScrollButtonsDisabledState(); aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
}; };
setTimeout(_delayedUpdate, 0, this.tabContainer); setTimeout(_delayedUpdate, 0, this.tabContainer);
@ -1754,7 +1754,7 @@
case "browser.tabs.closeButtons": case "browser.tabs.closeButtons":
subject.QueryInterface(Components.interfaces.nsIPrefBranch); subject.QueryInterface(Components.interfaces.nsIPrefBranch);
this.tabbox.mCloseButtons = subject.getIntPref("browser.tabs.closeButtons"); this.tabbox.mCloseButtons = subject.getIntPref("browser.tabs.closeButtons");
this.tabbox.adjustTabstrip(); this.tabbox._updateCloseButtons();
break; break;
} }
} }
@ -1806,7 +1806,7 @@
// |setTimeout| here to ensure we're post reflow // |setTimeout| here to ensure we're post reflow
var _delayedUpdate = function(aTabContainer) { var _delayedUpdate = function(aTabContainer) {
aTabContainer.adjustTabstrip(); aTabContainer._updateCloseButtons();
if (aTabContainer.selectedItem != tab) if (aTabContainer.selectedItem != tab)
aTabContainer._notifyBackgroundTab(tab); aTabContainer._notifyBackgroundTab(tab);
@ -1831,7 +1831,7 @@
]]></body> ]]></body>
</method> </method>
<method name="adjustTabstrip"> <method name="_updateCloseButtons">
<body><![CDATA[ <body><![CDATA[
// modes for tabstrip // modes for tabstrip
// 0 - activetab = close button on active tab only // 0 - activetab = close button on active tab only
@ -1895,7 +1895,7 @@
case "resize": case "resize":
var width = this.mTabstrip.boxObject.width; var width = this.mTabstrip.boxObject.width;
if (width != this.mTabstripWidth) { if (width != this.mTabstripWidth) {
this.adjustTabstrip(); this._updateCloseButtons();
this._fillTrailingGap(); this._fillTrailingGap();
this._handleTabSelect(); this._handleTabSelect();
this.mTabstripWidth = width; this.mTabstripWidth = width;

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

@ -519,7 +519,7 @@
this.tabContainer.appendChild(t); this.tabContainer.appendChild(t);
if (this.tabContainer.mCollapseToolbar.collapsed) { if (this.tabContainer.mCollapseToolbar.collapsed) {
this.tabContainer.mCollapseToolbar.collapsed = false; this.tabContainer.mCollapseToolbar.collapsed = false;
this.tabContainer.adjustTabstrip(); this.tabContainer._updateCloseButtons();
} }
let oldTab = this._mostRecentTabInfo = this.currentTabInfo; let oldTab = this._mostRecentTabInfo = this.currentTabInfo;
@ -1749,7 +1749,7 @@
this.firstChild.minWidth = this.mTabMinWidth; this.firstChild.minWidth = this.mTabMinWidth;
this.firstChild.maxWidth = this.mTabMaxWidth; this.firstChild.maxWidth = this.mTabMaxWidth;
this.adjustTabstrip(); this._updateCloseButtons();
Services.prefs.addObserver("mail.tabs.", this._prefObserver); Services.prefs.addObserver("mail.tabs.", this._prefObserver);
@ -1818,7 +1818,7 @@
switch (data) { switch (data) {
case "mail.tabs.closeButtons": case "mail.tabs.closeButtons":
this.tabbox.mCloseButtons = subject.getIntPref("mail.tabs.closeButtons"); this.tabbox.mCloseButtons = subject.getIntPref("mail.tabs.closeButtons");
this.tabbox.adjustTabstrip(); this.tabbox._updateCloseButtons();
break; break;
case "mail.tabs.autoHide": case "mail.tabs.autoHide":
this.tabbox.mAutoHide = subject.getBoolPref("mail.tabs.autoHide"); this.tabbox.mAutoHide = subject.getBoolPref("mail.tabs.autoHide");
@ -1863,7 +1863,7 @@
]]></setter> ]]></setter>
</property> </property>
<method name="adjustTabstrip"> <method name="_updateCloseButtons">
<body><![CDATA[ <body><![CDATA[
// modes for tabstrip // modes for tabstrip
// 0 - activetab = close button on active tab only // 0 - activetab = close button on active tab only
@ -1911,7 +1911,7 @@
case "resize": case "resize":
var width = this.mTabstrip.boxObject.width; var width = this.mTabstrip.boxObject.width;
if (width != this.mTabstripWidth) { if (width != this.mTabstripWidth) {
this.adjustTabstrip(); this._updateCloseButtons();
// XXX without this line the tab bar won't budge // XXX without this line the tab bar won't budge
this.mTabstrip.scrollByPixels(1); this.mTabstrip.scrollByPixels(1);
this._handleTabSelect(); this._handleTabSelect();

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

@ -416,7 +416,7 @@
if (!this.mStripVisible) if (!this.mStripVisible)
{ {
this.mStripVisible = true; this.mStripVisible = true;
this.tabContainer.adjustTabstrip(); this.tabContainer._updateCloseButtons();
} }
let oldPanel = this.panelContainer.selectedPanel; let oldPanel = this.panelContainer.selectedPanel;
@ -1051,7 +1051,7 @@
this.mCloseButtons = this.mPrefs.getIntPref ("browser.tabs.closeButtons"); this.mCloseButtons = this.mPrefs.getIntPref ("browser.tabs.closeButtons");
this.firstChild.minWidth = this.mTabMinWidth; this.firstChild.minWidth = this.mTabMinWidth;
this.firstChild.maxWidth = this.mTabMaxWidth; this.firstChild.maxWidth = this.mTabMaxWidth;
this.adjustTabstrip(); this._updateCloseButtons();
this.mPrefs.addObserver("browser.tabs.", this); this.mPrefs.addObserver("browser.tabs.", this);
window.addEventListener("resize", this); window.addEventListener("resize", this);
@ -1099,7 +1099,7 @@
<field name="mTabMaxWidth">250</field> <field name="mTabMaxWidth">250</field>
<field name="mTabClipWidth">140</field> <field name="mTabClipWidth">140</field>
<field name="mCloseButtons">3</field> <field name="mCloseButtons">3</field>
<method name="adjustTabstrip"> <method name="_updateCloseButtons">
<body> <body>
<![CDATA[ <![CDATA[
// modes for tabstrip // modes for tabstrip
@ -1159,7 +1159,7 @@
let width = this.mTabstrip.boxObject.width; let width = this.mTabstrip.boxObject.width;
if (width != this.mTabstripWidth) if (width != this.mTabstripWidth)
{ {
this.adjustTabstrip(); this._updateCloseButtons();
// XXX without this line the tab bar won't budge // XXX without this line the tab bar won't budge
this.mTabstrip.scrollByPixels(1); this.mTabstrip.scrollByPixels(1);
this._handleTabSelect(); this._handleTabSelect();
@ -1279,7 +1279,7 @@
if (aTopic == "nsPref:changed" && aData == kCloseButtons) if (aTopic == "nsPref:changed" && aData == kCloseButtons)
{ {
this.mCloseButtons = this.mPrefs.getIntPref(kCloseButtons); this.mCloseButtons = this.mPrefs.getIntPref(kCloseButtons);
this.adjustTabstrip(); this._updateCloseButtons();
} }
]]> ]]>
</body> </body>