mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 17:36:34 +00:00
Adjust tab rotation angle and enhance pinned tab loading logic for improved user experience
This commit is contained in:
@@ -875,7 +875,7 @@
|
||||
right: calc(var(--tab-inline-padding) / 2 - 1px);
|
||||
top: 50%;
|
||||
border-radius: 2px;
|
||||
transform: rotate(12deg) translateY(-50%);
|
||||
transform: rotate(10deg) translateY(-50%);
|
||||
}
|
||||
|
||||
&:hover::after {
|
||||
|
@@ -423,7 +423,7 @@ button.popup-notification-dropmarker {
|
||||
--urlbar-container-height: 55px !important;
|
||||
--urlbar-margin-inline: 10px !important;
|
||||
|
||||
width: min(90%, 45rem) !important;
|
||||
width: min(90%, 50rem) !important;
|
||||
font-size: 1.15em !important;
|
||||
@media (-moz-platform: macos) {
|
||||
font-size: 1.5em !important;
|
||||
|
@@ -71,6 +71,7 @@
|
||||
|
||||
if (onInit) {
|
||||
await this._refreshPinnedTabs({ init: onInit });
|
||||
this._hasFinishedLoading = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +131,7 @@
|
||||
|
||||
async _refreshPinnedTabs({ init = false } = {}) {
|
||||
await ZenWorkspaces.promiseSectionsInitialized;
|
||||
console.log('Refreshing pinned tabs');
|
||||
await this._initializePinsCache();
|
||||
await this._initializePinnedTabs(init);
|
||||
}
|
||||
@@ -400,7 +402,7 @@
|
||||
}
|
||||
|
||||
async _setPinnedAttributes(tab) {
|
||||
if (tab.hasAttribute('zen-pin-id')) {
|
||||
if (tab.hasAttribute('zen-pin-id') || !this._hasFinishedLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -107,6 +107,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
selectEmptyTab() {
|
||||
console.log(new Error().stack);
|
||||
if (this._emptyTab && Services.prefs.getBoolPref('zen.urlbar.replace-newtab')) {
|
||||
gBrowser.selectedTab = this._emptyTab;
|
||||
return this._emptyTab;
|
||||
@@ -596,15 +597,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
|
||||
_selectStartPage() {
|
||||
const currentTab = gBrowser.selectedTab;
|
||||
const isEssential = currentTab.hasAttribute('zen-essential');
|
||||
if (isEssential) {
|
||||
let showed = false;
|
||||
if (currentTab.pinned) {
|
||||
this.selectEmptyTab();
|
||||
return;
|
||||
}
|
||||
showed = true;
|
||||
} else {
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
get normalTabCount() {
|
||||
return this.tabboxChildren.length - 1;
|
||||
}
|
||||
|
||||
get allWorkspaceTabs() {
|
||||
const currentWorkspace = this.activeWorkspace;
|
||||
return this.allStoredTabs.filter(
|
||||
|
@@ -1,5 +1,5 @@
|
||||
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
|
||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||
@@ -94,7 +94,7 @@
|
||||
@@ -276,9 +276,10 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..c96e563a31b4c32c855cc2d250d70236
|
||||
- );
|
||||
+ let verticalTabsContainer = this.verticalPinnedTabsContainer;
|
||||
let numPinned = gBrowser.pinnedTabCount;
|
||||
|
||||
-
|
||||
- if (gBrowser.pinnedTabCount !== verticalTabsContainer.children.length) {
|
||||
- let tabs = this.visibleTabs;
|
||||
+ if (!ZenWorkspaces._hasInitializedTabsStrip) return;
|
||||
+ let count = ZenWorkspaces.makeSurePinTabIsInCorrectPosition();
|
||||
+ 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"));
|
||||
|
Reference in New Issue
Block a user