Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 593c615

Browse files
committed
🐛 Fix vertical tab open / close cleanup
1 parent 1ca8010 commit 593c615

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

src/browser/base/content/tabbrowser-tabs-js.patch

+25-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
diff --git a/browser/base/content/tabbrowser-tabs.js b/browser/base/content/tabbrowser-tabs.js
2-
index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b5203c334738 100644
2+
index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..6426d849d2afa12e123f8a1811aeb16515448158 100644
33
--- a/browser/base/content/tabbrowser-tabs.js
44
+++ b/browser/base/content/tabbrowser-tabs.js
5-
@@ -513,19 +513,40 @@
5+
@@ -168,7 +168,14 @@
6+
}
7+
8+
on_transitionend(event) {
9+
- if (event.propertyName != "max-width") {
10+
+ const verticalTabs = Services.prefs.getBoolPref(
11+
+ "pulse.tabs.vertical",
12+
+ false
13+
+ );
14+
+
15+
+ // NOTE: Vertical tabs use max-height instead of max-width to animate on
16+
+ // open / close
17+
+ if ((!verticalTabs && event.propertyName != "max-width") || (!verticalTabs && event.propertyName != "max-height")) {
18+
return;
19+
}
20+
21+
@@ -513,19 +520,40 @@
622
}
723
dt.setDragImage(toDrag, dragImageOffset, dragImageOffset);
824

@@ -44,7 +60,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
4460
movingTabs: (tab.multiselected ? gBrowser.selectedTabs : [tab]).filter(
4561
t => t.pinned == tab.pinned
4662
),
47-
@@ -612,21 +633,31 @@
63+
@@ -612,21 +640,31 @@
4864
}
4965
}
5066

@@ -81,7 +97,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
8197
];
8298
}
8399
newMargin = pixelsToScroll > 0 ? maxMargin : minMargin;
84-
@@ -635,30 +666,40 @@
100+
@@ -635,30 +673,40 @@
85101
let children = this.allTabs;
86102
if (newIndex == children.length) {
87103
let tabRect = this._getVisibleTabs().at(-1).getBoundingClientRect();
@@ -130,7 +146,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
130146
var dt = event.dataTransfer;
131147
var dropEffect = dt.dropEffect;
132148
var draggedTab;
133-
@@ -715,7 +756,7 @@
149+
@@ -715,7 +763,7 @@
134150
incrementDropIndex = false;
135151
}
136152

@@ -139,7 +155,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
139155
for (let tab of movingTabs) {
140156
tab.setAttribute("tabdrop-samewindow", "true");
141157
tab.style.transform = "translateX(" + newTranslateX + "px)";
142-
@@ -1485,19 +1526,33 @@
158+
@@ -1485,19 +1533,33 @@
143159
}
144160
}
145161

@@ -179,7 +195,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
179195

180196
let pinned = draggedTab.pinned;
181197
let numPinned = gBrowser._numPinnedTabs;
182-
@@ -1506,36 +1561,40 @@
198+
@@ -1506,36 +1568,40 @@
183199
pinned ? numPinned : undefined
184200
);
185201

@@ -231,7 +247,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
231247
}
232248

233249
draggedTab._dragData.translateX = translateX;
234-
@@ -1568,11 +1627,11 @@
250+
@@ -1568,11 +1634,11 @@
235251
if (tabs[mid] == draggedTab && ++mid > high) {
236252
break;
237253
}
@@ -245,7 +261,7 @@ index 06c2479886f0e3a7c5ba6d8d939a2c1f0f19442d..7169efb6fbf88071bfb45cacc138b520
245261
tabCenter
246262
) {
247263
low = mid + 1;
248-
@@ -1595,16 +1654,16 @@
264+
@@ -1595,16 +1661,16 @@
249265
for (let tab of tabs) {
250266
if (tab != draggedTab) {
251267
let shift = getTabShift(tab, newIndex);

src/browser/themes/pulse/vertical_tabs.css

+11-7
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,23 @@
5757
background-color: var(--lwt-accent-color-inactive, var(--lwt-accent-color));
5858
}
5959

60+
/* Put the new tab button on the bottom */
61+
#browser #TabsToolbar #TabsToolbar-customization-target {
62+
flex-direction: column;
63+
height: 100%;
64+
/* Not sure why, but this forces the scroll box to scroll */
65+
max-height: 100%;
66+
}
67+
6068
#browser #TabsToolbar .tabbrowser-tab {
6169
max-width: unset;
6270
width: 100%;
6371

6472
/* Stops the tabs from getting squished or stretched */
6573
min-height: unset;
6674
max-height: var(--tab-min-height);
67-
}
6875

69-
/* Put the new tab button on the bottom */
70-
#browser #TabsToolbar #TabsToolbar-customization-target {
71-
flex-direction: column;
72-
height: 100%;
73-
/* Not sure why, but this forces the scroll box to scroll */
74-
max-height: 100%;
76+
transition: min-height 150ms ease-in-out, max-height 150ms ease-in-out;
7577
}
7678

7779
/* Work around for tab closing animation whilst in vertical tabs. Without this
@@ -80,6 +82,8 @@
8082
function. This isn't that performant, so we should look into fixing it in
8183
the future */
8284
#browser #TabsToolbar .tabbrowser-tab:not([pinned], [fadein]) {
85+
min-width: 0.1px;
86+
max-width: 0.1px;
8387
max-width: 0.1px;
8488
max-height: 0.1px;
8589
}

0 commit comments

Comments
 (0)