mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-07 03:48:22 +00:00
161 lines
5.8 KiB
C++
161 lines
5.8 KiB
C++
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
|
index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..93be23da305a5e2e51bff1c5b5f287439a8fafa8 100644
|
|
--- a/browser/components/tabbrowser/content/tabs.js
|
|
+++ b/browser/components/tabbrowser/content/tabs.js
|
|
@@ -649,7 +649,7 @@
|
|
if (this.#isContainerVerticalPinnedExpanded(tab)) {
|
|
// In expanded vertical mode, the max number of pinned tabs per row is dynamic
|
|
// Set this before adjusting dragged tab's position
|
|
- let pinnedTabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount);
|
|
+ let pinnedTabs = this.visibleTabs.slice(0, gBrowser._numVisiblePinTabs);
|
|
let tabsPerRow = 0;
|
|
let position = 0;
|
|
for (let pinnedTab of pinnedTabs) {
|
|
@@ -1076,7 +1076,7 @@
|
|
let postTransitionCleanup = () => {
|
|
tab.removeAttribute("tabdrop-samewindow");
|
|
|
|
- this._finishAnimateTabMove();
|
|
+ this._finishAnimateTabMove(true);
|
|
if (dropIndex !== false) {
|
|
gBrowser.moveTabTo(tab, dropIndex);
|
|
if (incrementDropIndex) {
|
|
@@ -1086,7 +1086,7 @@
|
|
|
|
gBrowser.syncThrobberAnimations(tab);
|
|
};
|
|
- if (gReduceMotion) {
|
|
+ if (gReduceMotion || true) {
|
|
postTransitionCleanup();
|
|
} else {
|
|
let onTransitionEnd = transitionendEvent => {
|
|
@@ -1238,7 +1238,8 @@
|
|
if (
|
|
dt.mozUserCancelled ||
|
|
dt.dropEffect != "none" ||
|
|
- this._isCustomizing
|
|
+ this._isCustomizing ||
|
|
+ draggedTab.pinned
|
|
) {
|
|
delete draggedTab._dragData;
|
|
return;
|
|
@@ -1487,7 +1488,7 @@
|
|
}
|
|
|
|
this.#allTabs = [
|
|
- ...this.verticalPinnedTabsContainer.children,
|
|
+ ...document.getElementById("zen-essentials-container").children, ...this.verticalPinnedTabsContainer.children,
|
|
...children,
|
|
];
|
|
return this.#allTabs;
|
|
@@ -1556,6 +1557,7 @@
|
|
}
|
|
|
|
this.#focusableItems = [
|
|
+ ...document.getElementById("zen-essentials-container").children,
|
|
...verticalPinnedTabsContainer.children,
|
|
...focusableItems,
|
|
];
|
|
@@ -1579,8 +1581,8 @@
|
|
#isContainerVerticalPinnedExpanded(tab) {
|
|
return (
|
|
this.verticalMode &&
|
|
- tab.hasAttribute("pinned") &&
|
|
- this.hasAttribute("expanded")
|
|
+ (tab.hasAttribute("zen-essential")) &&
|
|
+ (this.hasAttribute("expanded") || document.documentElement.hasAttribute("zen-sidebar-expanded"))
|
|
);
|
|
}
|
|
|
|
@@ -1790,10 +1792,12 @@
|
|
|
|
_handleTabSelect(aInstant) {
|
|
let selectedTab = this.selectedItem;
|
|
- if (this.overflowing) {
|
|
- this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant);
|
|
- }
|
|
+ this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant);
|
|
|
|
+ if (!aInstant && Services.prefs.getBoolPref('zen.view.compact')
|
|
+ && Services.prefs.getBoolPref('zen.view.compact.toolbar-flash-popup')) {
|
|
+ gZenCompactModeManager.flashSidebar();
|
|
+ }
|
|
selectedTab._notselectedsinceload = false;
|
|
}
|
|
|
|
@@ -1841,7 +1845,7 @@
|
|
if (isEndTab && !this._hasTabTempMaxWidth) {
|
|
return;
|
|
}
|
|
- let numPinned = gBrowser.pinnedTabCount;
|
|
+ let numPinned = gBrowser._numVisiblePinTabs;
|
|
// Force tabs to stay the same width, unless we're closing the last tab,
|
|
// which case we need to let them expand just enough so that the overall
|
|
// tabbar width is the same.
|
|
@@ -1856,7 +1860,7 @@
|
|
let tabsToReset = [];
|
|
for (let i = numPinned; i < tabs.length; i++) {
|
|
let tab = tabs[i];
|
|
- tab.style.setProperty("max-width", aTabWidth, "important");
|
|
+ //tab.style.setProperty("max-width", aTabWidth, "important");
|
|
if (!isEndTab) {
|
|
// keep tabs the same width
|
|
tab.style.transition = "none";
|
|
@@ -1922,13 +1926,13 @@
|
|
let verticalTabsContainer = document.getElementById(
|
|
"vertical-pinned-tabs-container"
|
|
);
|
|
- let numPinned = gBrowser.pinnedTabCount;
|
|
+ let numPinned = gBrowser._numVisiblePinTabs;
|
|
|
|
if (gBrowser.pinnedTabCount !== verticalTabsContainer.children.length) {
|
|
let tabs = this.visibleTabs;
|
|
for (let i = 0; i < numPinned; i++) {
|
|
tabs[i].style.marginInlineStart = "";
|
|
- verticalTabsContainer.appendChild(tabs[i]);
|
|
+ tabs[i].hasAttribute("zen-essential") ? document.getElementById("zen-essentials-container").appendChild(tabs[i]) : verticalTabsContainer.appendChild(tabs[i]);
|
|
}
|
|
}
|
|
|
|
@@ -1952,7 +1956,7 @@
|
|
|
|
_positionPinnedTabs() {
|
|
let tabs = this.visibleTabs;
|
|
- let numPinned = gBrowser.pinnedTabCount;
|
|
+ let numPinned = gBrowser._numVisiblePinTabs;
|
|
let absPositionHorizontalTabs =
|
|
this.overflowing && tabs.length > numPinned && numPinned > 0;
|
|
|
|
@@ -2033,7 +2037,7 @@
|
|
return;
|
|
}
|
|
|
|
- let tabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount);
|
|
+ let tabs = this.visibleTabs.slice(0, gBrowser._numVisiblePinTabs);
|
|
|
|
let directionX = screenX > dragData.animLastScreenX;
|
|
let directionY = screenY > dragData.animLastScreenY;
|
|
@@ -2221,9 +2225,9 @@
|
|
}
|
|
|
|
let pinned = draggedTab.pinned;
|
|
- let numPinned = gBrowser.pinnedTabCount;
|
|
+ let numPinned = gBrowser._numVisiblePinTabs;
|
|
let tabs = this.visibleTabs.slice(
|
|
- pinned ? 0 : numPinned,
|
|
+ pinned ? gBrowser._numZenEssentials : numPinned,
|
|
pinned ? numPinned : undefined
|
|
);
|
|
|
|
@@ -2456,8 +2460,8 @@
|
|
);
|
|
}
|
|
|
|
- _finishAnimateTabMove() {
|
|
- if (!this.hasAttribute("movingtab")) {
|
|
+ _finishAnimateTabMove(always = false) {
|
|
+ if (!this.hasAttribute("movingtab") && !always) {
|
|
return;
|
|
}
|
|
|