Adjust tab rotation angle and enhance pinned tab loading logic for improved user experience

This commit is contained in:
mr. M
2025-02-21 16:50:16 +01:00
parent 22060f90bf
commit 68cf549df3
5 changed files with 21 additions and 16 deletions

View File

@@ -875,7 +875,7 @@
right: calc(var(--tab-inline-padding) / 2 - 1px); right: calc(var(--tab-inline-padding) / 2 - 1px);
top: 50%; top: 50%;
border-radius: 2px; border-radius: 2px;
transform: rotate(12deg) translateY(-50%); transform: rotate(10deg) translateY(-50%);
} }
&:hover::after { &:hover::after {

View File

@@ -423,7 +423,7 @@ button.popup-notification-dropmarker {
--urlbar-container-height: 55px !important; --urlbar-container-height: 55px !important;
--urlbar-margin-inline: 10px !important; --urlbar-margin-inline: 10px !important;
width: min(90%, 45rem) !important; width: min(90%, 50rem) !important;
font-size: 1.15em !important; font-size: 1.15em !important;
@media (-moz-platform: macos) { @media (-moz-platform: macos) {
font-size: 1.5em !important; font-size: 1.5em !important;

View File

@@ -71,6 +71,7 @@
if (onInit) { if (onInit) {
await this._refreshPinnedTabs({ init: onInit }); await this._refreshPinnedTabs({ init: onInit });
this._hasFinishedLoading = true;
} }
} }
@@ -130,6 +131,7 @@
async _refreshPinnedTabs({ init = false } = {}) { async _refreshPinnedTabs({ init = false } = {}) {
await ZenWorkspaces.promiseSectionsInitialized; await ZenWorkspaces.promiseSectionsInitialized;
console.log('Refreshing pinned tabs');
await this._initializePinsCache(); await this._initializePinsCache();
await this._initializePinnedTabs(init); await this._initializePinnedTabs(init);
} }
@@ -400,7 +402,7 @@
} }
async _setPinnedAttributes(tab) { async _setPinnedAttributes(tab) {
if (tab.hasAttribute('zen-pin-id')) { if (tab.hasAttribute('zen-pin-id') || !this._hasFinishedLoading) {
return; return;
} }

View File

@@ -107,6 +107,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
} }
selectEmptyTab() { selectEmptyTab() {
console.log(new Error().stack);
if (this._emptyTab && Services.prefs.getBoolPref('zen.urlbar.replace-newtab')) { if (this._emptyTab && Services.prefs.getBoolPref('zen.urlbar.replace-newtab')) {
gBrowser.selectedTab = this._emptyTab; gBrowser.selectedTab = this._emptyTab;
return this._emptyTab; return this._emptyTab;
@@ -596,15 +597,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
_selectStartPage() { _selectStartPage() {
const currentTab = gBrowser.selectedTab; const currentTab = gBrowser.selectedTab;
const isEssential = currentTab.hasAttribute('zen-essential'); let showed = false;
if (isEssential) { if (currentTab.pinned) {
this.selectEmptyTab(); this.selectEmptyTab();
return; showed = true;
} } else {
const currentTabUrl = currentTab.linkedBrowser?.currentURI.spec; const currentTabUrl = currentTab.linkedBrowser?.currentURI.spec;
if (currentTabUrl === 'about:blank' || currentTabUrl === 'about:newtab' || currentTabUrl === 'about:home') { if (currentTabUrl === 'about:newtab' || currentTabUrl === 'about:home') {
this.selectEmptyTab(); this.selectEmptyTab();
gBrowser.removeTab(currentTab); gBrowser.removeTab(currentTab);
showed = true;
}
}
if (Services.prefs.getBoolPref('zen.urlbar.replace-newtab') && showed) {
BrowserCommands.openTab();
} }
} }
@@ -2225,10 +2231,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return this.pinnedTabsContainer.children.length - 1; return this.pinnedTabsContainer.children.length - 1;
} }
get normalTabCount() {
return this.tabboxChildren.length - 1;
}
get allWorkspaceTabs() { get allWorkspaceTabs() {
const currentWorkspace = this.activeWorkspace; const currentWorkspace = this.activeWorkspace;
return this.allStoredTabs.filter( return this.allStoredTabs.filter(

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index 8aeb244ffca9f48661805f5b7d860b5896055562..c96e563a31b4c32c855cc2d250d702361b427f88 100644 index 8aeb244ffca9f48661805f5b7d860b5896055562..2b988219f279f7b6e1178518e436a7f2b437ce20 100644
--- a/browser/components/tabbrowser/content/tabs.js --- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
@@ -276,9 +276,10 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..c96e563a31b4c32c855cc2d250d70236
- ); - );
+ let verticalTabsContainer = this.verticalPinnedTabsContainer; + let verticalTabsContainer = this.verticalPinnedTabsContainer;
let numPinned = gBrowser.pinnedTabCount; let numPinned = gBrowser.pinnedTabCount;
-
- if (gBrowser.pinnedTabCount !== verticalTabsContainer.children.length) { - if (gBrowser.pinnedTabCount !== verticalTabsContainer.children.length) {
- let tabs = this.visibleTabs; - let tabs = this.visibleTabs;
+ if (!ZenWorkspaces._hasInitializedTabsStrip) return;
+ let count = ZenWorkspaces.makeSurePinTabIsInCorrectPosition(); + let count = ZenWorkspaces.makeSurePinTabIsInCorrectPosition();
+ if (gBrowser.pinnedTabCount !== (verticalTabsContainer.children.length - count - 1 + document.getElementById("zen-essentials-container").children.length)) { + if (gBrowser.pinnedTabCount !== (verticalTabsContainer.children.length - count - 1 + document.getElementById("zen-essentials-container").children.length)) {
+ let tabs = this.allTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")); + let tabs = this.allTabs.filter(tab => !tab.hasAttribute("zen-glance-tab"));