From 6e7a2e4c9e7d1407e477ed298f2e143bd0eb4c16 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Tue, 15 Oct 2024 10:57:09 +0200 Subject: [PATCH] Hide deactivated workspaces are now an option --- l10n | 2 +- src/browser/app/profile/zen-browser.js | 1 + .../zen-styles/zen-tabs/vertical-tabs.css | 18 +++++----- .../content/zen-styles/zen-workspaces.css | 35 ++++++++++++++----- .../components/preferences/zen-settings.js | 5 +++ .../preferences/zenTabsManagement.inc.xhtml | 8 +++-- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/l10n b/l10n index 6e0c5ca64..2a2603de7 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit 6e0c5ca64550b31fa4ad5b0dc8bd3a8019ab1deb +Subproject commit 2a2603de70e6320d17b269c62f5126ae7cfccb89 diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index 0a59b5700..b0c6db448 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -132,6 +132,7 @@ pref('zen.splitView.rearrange-hover-size', 24); // Zen Workspaces pref('zen.workspaces.enabled', true); +pref('zen.workspaces.hide-deactivated-workspaces', true); pref('zen.workspaces.hide-default-container-indicator', true); pref('zen.workspaces.individual-pinned-tabs', true); pref('zen.workspaces.show-icon-strip', true); diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index a8ea3c232..2f487673b 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -474,15 +474,17 @@ transform: translateY(50%) !important; } - :root:has(#navigator-toolbox:not([zen-right-side='true'])) &[active='true']::after { - left: -2px; - animation: zen-workspaces-button-active-collapsed-left 0.1s ease-in-out !important; - } + @media not (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') { + :root:has(#navigator-toolbox:not([zen-right-side='true'])) &[active='true']::after { + left: -2px; + animation: zen-workspaces-button-active-collapsed-left 0.1s ease-in-out !important; + } - :root:has(#navigator-toolbox[zen-right-side='true']) &[active='true']::after { - left: unset !important; - right: -2px; - animation: zen-workspaces-button-active-collapsed-right 0.1s ease-in-out !important; + :root:has(#navigator-toolbox[zen-right-side='true']) &[active='true']::after { + left: unset !important; + right: -2px; + animation: zen-workspaces-button-active-collapsed-right 0.1s ease-in-out !important; + } } } } diff --git a/src/browser/base/content/zen-styles/zen-workspaces.css b/src/browser/base/content/zen-styles/zen-workspaces.css index 1d020abe9..209a7f91c 100644 --- a/src/browser/base/content/zen-styles/zen-workspaces.css +++ b/src/browser/base/content/zen-styles/zen-workspaces.css @@ -29,21 +29,38 @@ opacity: 0.6; } - &:not([active='true']) { - &::after { + @media (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') { + &:not([active='true']) { + &::after { + content: ''; + position: absolute; + width: 4px; + border-radius: 99px; + height: 4px; + background: color-mix(in srgb, var(--zen-primary-color) 10%, light-dark(rgba(0,0,0,.4), rgba(255,255,255,.4)) 90%); + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + } + + & .zen-workspace-icon { + display: none; + } + } + } + + @media not (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') { + &[active='true']::after { content: ''; position: absolute; width: 4px; border-radius: 99px; height: 4px; - background: color-mix(in srgb, var(--zen-primary-color) 10%, light-dark(rgba(0,0,0,.4), rgba(255,255,255,.4)) 90%); + background: var(--zen-primary-color); + bottom: -2px; left: 50%; - top: 50%; - transform: translate(-50%, -50%); - } - - & .zen-workspace-icon { - display: none; + transform: translateX(-50%); + animation: zen-workspaces-button-active 0.1s ease-in-out; } } } diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index 12b1ac6ec..58fba4415 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -1020,6 +1020,11 @@ Preferences.addAll([ type: 'bool', default: false, }, + { + id: 'zen.workspaces.hide-deactivated-workspaces', + type: 'bool', + default: true, + }, { id: 'zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url', type: 'bool', diff --git a/src/browser/components/preferences/zenTabsManagement.inc.xhtml b/src/browser/components/preferences/zenTabsManagement.inc.xhtml index 875e3acb3..b69d8e951 100644 --- a/src/browser/components/preferences/zenTabsManagement.inc.xhtml +++ b/src/browser/components/preferences/zenTabsManagement.inc.xhtml @@ -31,8 +31,12 @@ data-l10n-id="zen-settings-workspaces-display-as-icon-strip" preference="zen.workspaces.show-icon-strip"/> + data-l10n-id="zen-settings-workspaces-force-container-tabs-to-workspace" + preference="zen.workspaces.force-container-workspace"/> + +