mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 17:36:34 +00:00
Fixed normal tabs appear on pinned tab container
This commit is contained in:
@@ -392,7 +392,7 @@ button.popup-notification-dropmarker {
|
|||||||
the backdrop woudn't work, we would need to apply a clip-path to the site and that's not recommended
|
the backdrop woudn't work, we would need to apply a clip-path to the site and that's not recommended
|
||||||
due to performance issues */
|
due to performance issues */
|
||||||
background-color: light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 14%)) !important;
|
background-color: light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 14%)) !important;
|
||||||
outline: 1px solid rgba(0,0,0,.3) !important;
|
outline: 1px solid rgba(0, 0, 0, 0.3) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTabPosition(tab) {
|
getTabPosition(tab) {
|
||||||
return Math.max(gBrowser.pinnedTabCount, tab._tPos);
|
return Math.max(gBrowser._numVisiblePinTabs, tab._tPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
createBrowserElement(url, currentTab, existingTab = null) {
|
createBrowserElement(url, currentTab, existingTab = null) {
|
||||||
@@ -574,6 +574,7 @@
|
|||||||
DOMContentLoaded: {},
|
DOMContentLoaded: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
matches: ["https://*/*"],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..39cb6ceda6154609daa8f3b84c4931de6604534f 100644
|
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..f7c02c14498b4ec5fcf5521480c88abac25a2283 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -406,11 +406,39 @@
|
@@ -406,11 +406,39 @@
|
||||||
@@ -44,7 +44,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..39cb6ceda6154609daa8f3b84c4931de
|
|||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -807,7 +835,7 @@
|
@@ -807,10 +835,10 @@
|
||||||
this.showTab(aTab);
|
this.showTab(aTab);
|
||||||
if (this.tabContainer.verticalMode) {
|
if (this.tabContainer.verticalMode) {
|
||||||
this._handleTabMove(aTab, () =>
|
this._handleTabMove(aTab, () =>
|
||||||
@@ -52,7 +52,20 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..39cb6ceda6154609daa8f3b84c4931de
|
|||||||
+ aTab.hasAttribute("zen-essential") ? document.getElementById("zen-essentials-container").appendChild(aTab) : this.verticalPinnedTabsContainer.appendChild(aTab)
|
+ aTab.hasAttribute("zen-essential") ? document.getElementById("zen-essentials-container").appendChild(aTab) : this.verticalPinnedTabsContainer.appendChild(aTab)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true });
|
- this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true });
|
||||||
|
+ this.moveTabTo(aTab, this._numVisiblePinTabs, { forceStandaloneTab: true });
|
||||||
|
}
|
||||||
|
aTab.setAttribute("pinned", "true");
|
||||||
|
this._updateTabBarForPinnedTabs();
|
||||||
|
@@ -831,7 +859,7 @@
|
||||||
|
this.tabContainer.arrowScrollbox.prepend(aTab);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
- this.moveTabTo(aTab, this.pinnedTabCount - 1, {
|
||||||
|
+ this.moveTabTo(aTab, this._numVisiblePinTabs - 1, {
|
||||||
|
forceStandaloneTab: true,
|
||||||
|
});
|
||||||
|
aTab.removeAttribute("pinned");
|
||||||
@@ -1055,6 +1083,8 @@
|
@@ -1055,6 +1083,8 @@
|
||||||
|
|
||||||
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
||||||
@@ -197,16 +210,36 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..39cb6ceda6154609daa8f3b84c4931de
|
|||||||
if (select) {
|
if (select) {
|
||||||
tabToSelect = tab;
|
tabToSelect = tab;
|
||||||
}
|
}
|
||||||
|
@@ -3464,8 +3546,8 @@
|
||||||
|
// inserted in the DOM. If the tab is not yet in the DOM,
|
||||||
|
// just insert it in the right place from the start.
|
||||||
|
if (!tab.parentNode) {
|
||||||
|
- tab._tPos = this.pinnedTabCount;
|
||||||
|
- this.tabContainer.insertBefore(tab, this.tabs[this.pinnedTabCount]);
|
||||||
|
+ tab._tPos = this._numVisiblePinTabs;
|
||||||
|
+ this.tabContainer.insertBefore(tab, this.tabs[this._numVisiblePinTabs]);
|
||||||
|
tab.toggleAttribute("pinned", true);
|
||||||
|
this.tabContainer._invalidateCachedTabs();
|
||||||
|
// Then ensure all the tab open/pinning information is sent.
|
||||||
@@ -3729,7 +3811,7 @@
|
@@ -3729,7 +3811,7 @@
|
||||||
// Ensure we have an index if one was not provided.
|
// Ensure we have an index if one was not provided.
|
||||||
if (typeof index != "number") {
|
if (typeof index != "number") {
|
||||||
// Move the new tab after another tab if needed, to the end otherwise.
|
// Move the new tab after another tab if needed, to the end otherwise.
|
||||||
- index = Infinity;
|
- index = Infinity;
|
||||||
+ index = Services.prefs.getBoolPref("zen.view.show-newtab-button-top") ? this.pinnedTabCount : Infinity;
|
+ index = Services.prefs.getBoolPref("zen.view.show-newtab-button-top") ? this._numVisiblePinTabs : Infinity;
|
||||||
if (
|
if (
|
||||||
!bulkOrderedOpen &&
|
!bulkOrderedOpen &&
|
||||||
((openerTab &&
|
((openerTab &&
|
||||||
@@ -3780,7 +3862,7 @@
|
@@ -3773,14 +3855,14 @@
|
||||||
|
// Ensure index is within bounds.
|
||||||
|
if (tab.pinned) {
|
||||||
|
index = Math.max(index, 0);
|
||||||
|
- index = Math.min(index, this.pinnedTabCount);
|
||||||
|
+ index = Math.min(index, this._numVisiblePinTabs);
|
||||||
|
} else {
|
||||||
|
- index = Math.max(index, this.pinnedTabCount);
|
||||||
|
+ index = Math.max(index, this._numVisiblePinTabs);
|
||||||
|
index = Math.min(index, this.tabs.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {MozTabbrowserTab|undefined} */
|
/** @type {MozTabbrowserTab|undefined} */
|
||||||
@@ -295,6 +328,18 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..39cb6ceda6154609daa8f3b84c4931de
|
|||||||
aTab.selected ||
|
aTab.selected ||
|
||||||
aTab.closing ||
|
aTab.closing ||
|
||||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||||
|
@@ -5706,9 +5799,9 @@
|
||||||
|
|
||||||
|
// Don't allow mixing pinned and unpinned tabs.
|
||||||
|
if (aTab.pinned) {
|
||||||
|
- aIndex = Math.min(aIndex, this.pinnedTabCount - 1);
|
||||||
|
+ aIndex = Math.min(aIndex, this._numVisiblePinTabs - 1);
|
||||||
|
} else {
|
||||||
|
- aIndex = Math.max(aIndex, this.pinnedTabCount);
|
||||||
|
+ aIndex = Math.max(aIndex, this._numVisiblePinTabs);
|
||||||
|
}
|
||||||
|
if (aTab._tPos == aIndex) {
|
||||||
|
return;
|
||||||
@@ -5727,6 +5820,9 @@
|
@@ -5727,6 +5820,9 @@
|
||||||
this.tabContainer.insertBefore(aTab, neighbor);
|
this.tabContainer.insertBefore(aTab, neighbor);
|
||||||
}
|
}
|
||||||
@@ -305,6 +350,15 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..39cb6ceda6154609daa8f3b84c4931de
|
|||||||
}
|
}
|
||||||
|
|
||||||
moveTabToGroup(aTab, aGroup) {
|
moveTabToGroup(aTab, aGroup) {
|
||||||
|
@@ -5802,7 +5898,7 @@
|
||||||
|
createLazyBrowser,
|
||||||
|
};
|
||||||
|
|
||||||
|
- let numPinned = this.pinnedTabCount;
|
||||||
|
+ let numPinned = this._numVisiblePinTabs;
|
||||||
|
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
|
||||||
|
params.pinned = true;
|
||||||
|
}
|
||||||
@@ -7443,6 +7539,7 @@
|
@@ -7443,6 +7539,7 @@
|
||||||
aWebProgress.isTopLevel
|
aWebProgress.isTopLevel
|
||||||
) {
|
) {
|
||||||
|
Reference in New Issue
Block a user