diff --git a/src/browser/base/content/ZenWorkspaces.mjs b/src/browser/base/content/ZenWorkspaces.mjs
index cfa350dc5..300764131 100644
--- a/src/browser/base/content/ZenWorkspaces.mjs
+++ b/src/browser/base/content/ZenWorkspaces.mjs
@@ -29,7 +29,20 @@ var ZenWorkspaces = {
return this._workspaceCache;
},
+ onWorkspacesEnabledChanged() {
+ if (this.workspaceEnabled) {
+ this.initializeWorkspaces();
+ } else {
+ this._workspaceCache = null;
+ document.getElementById("zen-workspaces-button")?.remove();
+ for (let tab of gBrowser.tabs) {
+ gBrowser.showTab(tab);
+ }
+ }
+ },
+
async initializeWorkspaces() {
+ Services.prefs.addObserver("zen.workspaces.enabled", this.onWorkspacesEnabledChanged.bind(this));
this.initializeWorkspacesButton();
let file = new FileUtils.File(this._storeFile);
if (!file.exists()) {
@@ -149,6 +162,10 @@ var ZenWorkspaces = {
initializeWorkspacesButton() {
if (!this.workspaceEnabled) {
return;
+ } else if (document.getElementById("zen-workspaces-button")) {
+ let button = document.getElementById("zen-workspaces-button");
+ button.removeAttribute("hidden");
+ return;
}
let browserTabs = document.getElementById("tabbrowser-tabs");
let button = document.createElement("toolbarbutton");
diff --git a/src/browser/components/preferences/jar-mn.patch b/src/browser/components/preferences/jar-mn.patch
index 5406d9c97..dad5f3088 100644
--- a/src/browser/components/preferences/jar-mn.patch
+++ b/src/browser/components/preferences/jar-mn.patch
@@ -1,5 +1,5 @@
diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn
-index 3b60d18e483bc3c4e9b4309f0dc1e4231b7116b1..aa30bc3de15b68ac90c12142a8851af99e1209ae 100644
+index 3b60d18e483bc3c4e9b4309f0dc1e4231b7116b1..e5b679b25941a7f1ed52db9fa3f7740a7220b9e4 100644
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -23,3 +23,5 @@ browser.jar:
@@ -7,4 +7,4 @@ index 3b60d18e483bc3c4e9b4309f0dc1e4231b7116b1..aa30bc3de15b68ac90c12142a8851af9
content/browser/preferences/web-appearance-dark.svg
content/browser/preferences/web-appearance-light.svg
+
-+ content/browser/preferences/zen-looks.js
++ content/browser/preferences/zen-settings.js
diff --git a/src/browser/components/preferences/preferences-js.patch b/src/browser/components/preferences/preferences-js.patch
index 42727afa3..600d7e46a 100644
--- a/src/browser/components/preferences/preferences-js.patch
+++ b/src/browser/components/preferences/preferences-js.patch
@@ -1,12 +1,13 @@
diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
-index c30a51c67ce636fa889090419a5c2642d74b4f49..b48ab31c564db4a4911c9fca291b4f09ba1025af 100644
+index 7e21bab426b6eb52fe84876d817fddbdb1a35ffc..fe23eb36a28a2baa4facad80a776e739ee6e43b1 100644
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
-@@ -198,6 +198,7 @@ function init_all() {
+@@ -196,6 +196,8 @@ function init_all() {
// the entire document.
Preferences.queueUpdateOfAllElements();
Services.telemetry.setEventRecordingEnabled("aboutpreferences", true);
+ register_module("paneZenLooks", gZenLooksAndFeel);
++ register_module("paneZenWorkspaces", gZenWorkspacesSettings);
register_module("paneGeneral", gMainPane);
register_module("paneHome", gHomePane);
diff --git a/src/browser/components/preferences/preferences-xhtml.patch b/src/browser/components/preferences/preferences-xhtml.patch
index 4f36a0ddf..02ddfbddb 100644
--- a/src/browser/components/preferences/preferences-xhtml.patch
+++ b/src/browser/components/preferences/preferences-xhtml.patch
@@ -1,5 +1,5 @@
diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
-index eee227822a772bec128d6adbe4f6aca90ed810f6..b52ee22054e3b2c80d4b780bc01507478becc583 100644
+index 3affb19d1a243da4a5782c9a4a5588d165b4119f..ccb56cc323ff5c3e94013de782af54911fc0c360 100644
--- a/browser/components/preferences/preferences.xhtml
+++ b/browser/components/preferences/preferences.xhtml
@@ -43,6 +43,8 @@
@@ -11,7 +11,7 @@ index eee227822a772bec128d6adbe4f6aca90ed810f6..b52ee22054e3b2c80d4b780bc0150747
-@@ -99,6 +101,12 @@
+@@ -97,6 +99,12 @@
@@ -24,7 +24,7 @@ index eee227822a772bec128d6adbe4f6aca90ed810f6..b52ee22054e3b2c80d4b780bc0150747
@@ -38,11 +38,22 @@ index eee227822a772bec128d6adbe4f6aca90ed810f6..b52ee22054e3b2c80d4b780bc0150747
+
+
+
++
++
++
++
++
+
@@ -56,11 +67,12 @@ index eee227822a772bec128d6adbe4f6aca90ed810f6..b52ee22054e3b2c80d4b780bc0150747
-@@ -248,6 +269,7 @@
+@@ -246,6 +278,8 @@
#include sync.inc.xhtml
#include experimental.inc.xhtml
#include moreFromMozilla.inc.xhtml
+#include zenLooksAndFeel.inc.xhtml
++#include zenWorkspaces.inc.xhtml
diff --git a/src/browser/components/preferences/zen-looks.js b/src/browser/components/preferences/zen-settings.js
similarity index 92%
rename from src/browser/components/preferences/zen-looks.js
rename to src/browser/components/preferences/zen-settings.js
index 82b2a4e05..432c4a30d 100644
--- a/src/browser/components/preferences/zen-looks.js
+++ b/src/browser/components/preferences/zen-settings.js
@@ -48,6 +48,11 @@ var gZenLooksAndFeel = {
},
};
+var gZenWorkspacesSettings = {
+ init() {
+ },
+};
+
Preferences.addAll([
{
id: "zen.theme.toolbar-themed",
@@ -64,4 +69,9 @@ Preferences.addAll([
type: "bool",
default: false,
},
+ {
+ id: "zen.workspaces.enabled",
+ type: "bool",
+ default: true,
+ }
]);
diff --git a/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml b/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml
index 2e0f46e7c..ac2dbafbd 100644
--- a/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml
+++ b/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/browser/locales/en-US/browser/preferences/zen-preferences.ftl b/src/browser/locales/en-US/browser/preferences/zen-preferences.ftl
index 60517347f..b0738d510 100644
--- a/src/browser/locales/en-US/browser/preferences/zen-preferences.ftl
+++ b/src/browser/locales/en-US/browser/preferences/zen-preferences.ftl
@@ -19,4 +19,16 @@ zen-side-panels-enabled =
zen-look-and-feel-compact-view-header = Show in compact view
zen-look-and-feel-compact-view-description = Only show the toolbars you use!
zen-look-and-feel-compact-view-enabled =
- .label = Enable { -brand-short-name }'s compact mode
\ No newline at end of file
+ .label = Enable { -brand-short-name }'s compact mode
+
+
+
+pane-zen-workspaces-title = Workspaces
+category-zen-workspaces =
+ .tooltiptext = { pane-workspaces-title }
+
+pane-zen-workspaces-header = Workspaces
+zen-settings-workspaces-header = General settings for workspaces
+zen-settings-workspaces-description = With workspaces, you can have multiple browsing sessions at once!
+zen-settings-workspaces-enabled =
+ .label = Enable Workspaces (Experimental)
diff --git a/src/browser/themes/shared/preferences/zen-preferences.css b/src/browser/themes/shared/preferences/zen-preferences.css
index 9f2653986..607a55434 100644
--- a/src/browser/themes/shared/preferences/zen-preferences.css
+++ b/src/browser/themes/shared/preferences/zen-preferences.css
@@ -185,3 +185,9 @@ groupbox h2 {
position: absolute;
background: var(--zen-colors-tertiary);
}
+
+/* Workspace */
+
+#category-zen-workspaces > .category-icon {
+ list-style-image: url("chrome://browser/skin/window.svg");
+}