mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
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:
parent
55a7b55790
commit
8ce2197e43
@ -5695,6 +5695,7 @@ var gUIDensity = {
|
||||
}
|
||||
|
||||
TabsInTitlebar.updateAppearance(true);
|
||||
gBrowser.tabContainer.uiDensityChanged();
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user