Bug 1354332 - Update the tab bar layout when the UI density changes. r=johannh

MozReview-Commit-ID: 1HGVirulaE3

--HG--
extra : rebase_source : 5b1ee45459696a45138534207c51c8ec2f3d58eb
This commit is contained in:
Dão Gottwald 2017-11-15 13:04:49 +01:00
parent 55a7b55790
commit 8ce2197e43
2 changed files with 13 additions and 1 deletions

View File

@ -5695,6 +5695,7 @@ var gUIDensity = {
}
TabsInTitlebar.updateAppearance(true);
gBrowser.tabContainer.uiDensityChanged();
},
};

View File

@ -6823,6 +6823,14 @@
]]></body>
</method>
<method name="uiDensityChanged">
<body><![CDATA[
this._positionPinnedTabs();
this._updateCloseButtons();
this._handleTabSelect(true);
]]></body>
</method>
<field name="_lastNumPinned">0</field>
<field name="_pinnedTabsLayoutCache">null</field>
<method name="_positionPinnedTabs">
@ -6835,9 +6843,12 @@
this.setAttribute("positionpinnedtabs", "true");
let layoutData = this._pinnedTabsLayoutCache;
if (!layoutData) {
let uiDensity = document.documentElement.getAttribute("uidensity");
if (!layoutData ||
layoutData.uiDensity != uiDensity) {
let arrowScrollbox = this.arrowScrollbox;
layoutData = this._pinnedTabsLayoutCache = {
uiDensity,
pinnedTabWidth: this.childNodes[0].getBoundingClientRect().width,
scrollButtonWidth: arrowScrollbox._scrollButtonDown.getBoundingClientRect().width
};