Allow pinned tabs to be for each individual workspace

This commit is contained in:
mauro-balades
2024-09-13 22:52:30 +02:00
parent 160a449086
commit a546d053ae
8 changed files with 52 additions and 12 deletions

2
l10n

Submodule l10n updated: a60e9734a5...c3bb1570dc

View File

@@ -109,6 +109,7 @@ pref('zen.splitView.working', false);
// Zen Workspaces // Zen Workspaces
pref('zen.workspaces.enabled', true); pref('zen.workspaces.enabled', true);
pref('zen.workspaces.hide-default-container-indicator', true); pref('zen.workspaces.hide-default-container-indicator', true);
pref('zen.workspaces.individual-pinned-tabs', true);
pref('zen.workspaces.icons', '["🌐", "📁", "📎", "📝", "📅", "📊"]'); pref('zen.workspaces.icons', '["🌐", "📁", "📎", "📝", "📅", "📊"]');
// Zen Watermark // Zen Watermark

View File

@@ -73,7 +73,7 @@
content: ''; content: '';
display: block; display: block;
height: 1px; height: 1px;
background: color-mix(in srgb, var(--zen-colors-border) 50%, transparent 50%); background: color-mix(in srgb, var(--zen-colors-border) 70%, transparent 30%);
margin: 0 auto; margin: 0 auto;
margin-block-end: 4px; margin-block-end: 4px;
width: 80%; width: 80%;
@@ -200,7 +200,8 @@
display: none; display: none;
} }
& .tab-icon-image { & .tab-icon-image,
& .tab-icon-pending {
margin-inline-end: 0 !important; margin-inline-end: 0 !important;
} }
} }

View File

@@ -6,6 +6,7 @@
align-items: center; align-items: center;
display: flex; display: flex;
box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px; box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
-moz-window-dragging: no-drag;
} }
#zen-workspaces-button .zen-workspace-sidebar-name { #zen-workspaces-button .zen-workspace-sidebar-name {

View File

@@ -609,4 +609,9 @@ Preferences.addAll([
type: 'bool', type: 'bool',
default: true, default: true,
}, },
{
id: 'zen.workspaces.individual-pinned-tabs',
type: 'bool',
default: true,
}
]); ]);

View File

@@ -20,11 +20,14 @@
<checkbox id="zenWorkspacesActivate" <checkbox id="zenWorkspacesActivate"
data-l10n-id="zen-settings-workspaces-enabled" data-l10n-id="zen-settings-workspaces-enabled"
preference="zen.workspaces.enabled"/> preference="zen.workspaces.enabled"/>
<box class="indent"> <vbox class="indent">
<checkbox id="zenWorkspacesHideDefaultContainer" <checkbox id="zenWorkspacesHideDefaultContainer"
data-l10n-id="zen-settings-workspaces-hide-default-container-indicator" data-l10n-id="zen-settings-workspaces-hide-default-container-indicator"
preference="zen.workspaces.hide-default-container-indicator"/> preference="zen.workspaces.hide-default-container-indicator"/>
</box> <checkbox id="zenWorkspacesAllowPinnedTabsForDifferentWorkspaces"
data-l10n-id="zen-settings-workspaces-allow-pinned-tabs-for-different-workspaces"
preference="zen.workspaces.individual-pinned-tabs"/>
</vbox>
</groupbox> </groupbox>
</html:template> </html:template>

View File

@@ -1,8 +1,24 @@
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 ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792a7781e8f 100644 index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..7774dbf9f963529570b08465d107df236fcefae7 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
@@ -2704,6 +2704,11 @@ @@ -453,10 +453,13 @@
},
get _numPinnedTabs() {
- for (var i = 0; i < this.tabs.length; i++) {
- if (!this.tabs[i].pinned) {
+ let i = 0;
+ for (let tab of this.tabs) {
+ if (!tab.pinned) {
break;
}
+ if (tab.hidden) continue;
+ i++;
}
return i;
},
@@ -2704,6 +2707,11 @@
); );
} }
@@ -14,7 +30,7 @@ index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792
if (!UserInteraction.running("browser.tabs.opening", window)) { if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window); UserInteraction.start("browser.tabs.opening", "initting", window);
} }
@@ -2771,6 +2776,9 @@ @@ -2771,6 +2779,9 @@
noInitialLabel, noInitialLabel,
skipBackgroundNotify, skipBackgroundNotify,
}); });
@@ -24,7 +40,7 @@ index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792
if (insertTab) { if (insertTab) {
// insert the tab into the tab container in the correct position // insert the tab into the tab container in the correct position
this._insertTabAtIndex(t, { this._insertTabAtIndex(t, {
@@ -3248,6 +3256,14 @@ @@ -3248,6 +3259,14 @@
) { ) {
tabWasReused = true; tabWasReused = true;
tab = this.selectedTab; tab = this.selectedTab;
@@ -39,7 +55,7 @@ index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792
if (!tabData.pinned) { if (!tabData.pinned) {
this.unpinTab(tab); this.unpinTab(tab);
} else { } else {
@@ -3297,6 +3313,13 @@ @@ -3297,6 +3316,13 @@
preferredRemoteType, preferredRemoteType,
}); });
@@ -53,7 +69,7 @@ index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792
if (select) { if (select) {
tabToSelect = tab; tabToSelect = tab;
} }
@@ -4184,6 +4207,7 @@ @@ -4184,6 +4210,7 @@
isLastTab || isLastTab ||
aTab.pinned || aTab.pinned ||
aTab.hidden || aTab.hidden ||
@@ -61,3 +77,16 @@ index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792
this._removingTabs.size > this._removingTabs.size >
3 /* don't want lots of concurrent animations */ || 3 /* don't want lots of concurrent animations */ ||
!aTab.hasAttribute( !aTab.hasAttribute(
@@ -5117,10 +5144,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
},
- hideTab(aTab, aSource) {
+ hideTab(aTab, aSource, forZenWorkspaces = false) {
if (
aTab.hidden ||
- aTab.pinned ||
+ (aTab.pinned && !forZenWorkspaces) ||
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.