Skip to content

Commit

Permalink
Enhance tab management by updating the toolbar on tab close and adjus…
Browse files Browse the repository at this point in the history
…ting overflow behavior for the tab browser
  • Loading branch information
mauro-balades committed Jan 27, 2025
1 parent 9203918 commit d4dd298
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ var gZenUIManager = {
this.sidebarHeightThrottle
)
).observe(document.getElementById('navigator-toolbox'));

window.addEventListener('TabClose', this.updateTabsToolbar.bind(this));
},

updateTabsToolbar() {
Expand Down
2 changes: 2 additions & 0 deletions src/browser/base/zen-components/ZenPinnedTabManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@
gBrowser.pinTab(tab);
this.onTabIconChanged(tab);
}
gZenUIManager.updateTabsToolbar();
}

removeEssentials() {
Expand All @@ -584,6 +585,7 @@
}
gBrowser.unpinTab(tab);
}
gZenUIManager.updateTabsToolbar();
}

_insertItemsIntoTabContextMenu() {
Expand Down
21 changes: 9 additions & 12 deletions src/toolkit/content/widgets/arrowscrollbox-js.patch
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit d4dd298

Please sign in to comment.