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

MozReview-Commit-ID: 1HGVirulaE3
This commit is contained in:
Dão Gottwald
2017-11-15 13:04:49 +01:00
parent 84a20a5c53
commit 9683c02535
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
};