Enhance tab management by updating the toolbar on tab close and adjusting overflow behavior for the tab browser

This commit is contained in:
mr. M
2025-01-27 01:23:01 +01:00
parent 9203918788
commit d4dd298ef8
3 changed files with 13 additions and 12 deletions

View File

@@ -22,6 +22,8 @@ var gZenUIManager = {
this.sidebarHeightThrottle
)
).observe(document.getElementById('navigator-toolbox'));
window.addEventListener('TabClose', this.updateTabsToolbar.bind(this));
},
updateTabsToolbar() {

View File

@@ -572,6 +572,7 @@
gBrowser.pinTab(tab);
this.onTabIconChanged(tab);
}
gZenUIManager.updateTabsToolbar();
}
removeEssentials() {
@@ -584,6 +585,7 @@
}
gBrowser.unpinTab(tab);
}
gZenUIManager.updateTabsToolbar();
}
_insertItemsIntoTabContextMenu() {

View File

@@ -1,19 +1,16 @@
diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js
index 328c770d275ebbaada8a44438eaf738b1a62d985..c7d178295745ed975f5a3e5dea028dbeeece1704 100644
index 328c770d275ebbaada8a44438eaf738b1a62d985..95460108c6356408170b8a4a40d55a8f0621756b 100644
--- a/toolkit/content/widgets/arrowscrollbox.js
+++ b/toolkit/content/widgets/arrowscrollbox.js
@@ -121,8 +121,10 @@
);
});
});
+ if (this.id !== 'tabbrowser-arrowscrollbox') {
overflowObserver.observe(slot);
overflowObserver.observe(this.scrollbox);
+ }
}
@@ -98,6 +98,7 @@
connectedCallback() {
@@ -639,7 +641,7 @@
let slot = this.shadowRoot.querySelector("slot");
let overflowObserver = new ResizeObserver(_ => {
+ if (this.id == 'tabbrowser-arrowscrollbox') return; // zen: do NOT underflow/overflow on tabbrowser-arrowscrollbox
let contentSize =
slot.getBoundingClientRect()[this.#verticalMode ? "height" : "width"];
// NOTE(emilio): This should be contentSize > scrollClientSize, but due
@@ -639,7 +640,7 @@
on_wheel(event) {
// Don't consume the event if we can't scroll.