1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 08:19:59 +02:00

refactor: Remove color settings on look and feel as they are no longer used, b=no-bug, c=common, workspaces

This commit is contained in:
Mr. M 2025-06-08 12:42:06 +02:00
parent 8fce658dc1
commit fd8a55c57c
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
19 changed files with 9 additions and 255 deletions

2
l10n

@ -1 +1 @@
Subproject commit e35864755963edb889fecbc6fa02042453652a2a
Subproject commit 7730ce9a6de8ef94a66dde31245982681d1203af

View file

@ -20,4 +20,3 @@ pref('zen.theme.acrylic-elements', false);
pref('zen.theme.acrylic-elements', false);
#endif
pref('zen.theme.color-prefs.use-workspace-colors', true);

View file

@ -1,16 +1,8 @@
diff --git a/browser/base/content/aboutDialog.xhtml b/browser/base/content/aboutDialog.xhtml
index c64980810570fcea84e33fdc2d66ac42a79f4e46..6ef9bf4b88f0a0539d833f662c4dd890fd1fde93 100644
index c64980810570fcea84e33fdc2d66ac42a79f4e46..11fe00e84dbac781b3da90abb1251c70bd3b094a 100644
--- a/browser/base/content/aboutDialog.xhtml
+++ b/browser/base/content/aboutDialog.xhtml
@@ -35,6 +35,7 @@
<html:link rel="localization" href="branding/brand.ftl"/>
<html:link rel="localization" href="browser/aboutDialog.ftl"/>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</linkset>
<html:div id="aboutDialogContainer">
@@ -102,10 +103,6 @@
@@ -102,10 +102,6 @@
<label id="version" class="update"/>
<label id="releasenotes" is="text-link" hidden="true" data-l10n-id="releaseNotes-link"/>
</hbox>
@ -21,7 +13,7 @@ index c64980810570fcea84e33fdc2d66ac42a79f4e46..6ef9bf4b88f0a0539d833f662c4dd890
</vbox>
#endif
</hbox>
@@ -125,21 +122,17 @@
@@ -125,21 +121,17 @@
</description>
</vbox>
<description class="text-blurb" id="communityDesc" data-l10n-id="community-2">

View file

@ -1,12 +0,0 @@
diff --git a/browser/base/content/aboutRestartRequired.xhtml b/browser/base/content/aboutRestartRequired.xhtml
index c1f42b4ddd3b154a8643fc5265c556904805bdff..9722e7de76b02077addfeda90a9acd8b921a9cd6 100644
--- a/browser/base/content/aboutRestartRequired.xhtml
+++ b/browser/base/content/aboutRestartRequired.xhtml
@@ -29,6 +29,7 @@
/>
<link rel="localization" href="branding/brand.ftl" />
<link rel="localization" href="browser/aboutRestartRequired.ftl" />
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body>
<!-- PAGE CONTAINER (for styling purposes only) -->

View file

@ -633,24 +633,9 @@ const kZenExtendedSidebar = 'zen.view.sidebar-expanded';
const kZenSingleToolbar = 'zen.view.use-single-toolbar';
var gZenLooksAndFeel = {
kZenColors: [
'#aac7ff',
'#74d7cb',
'#a0d490',
'#dec663',
'#ffb787',
'#dec1b1',
'#ffb1c0',
'#ddbfc3',
'#f6b0ea',
'#d4bbff',
],
init() {
if (this.__hasInitialized) return;
this.__hasInitialized = true;
this._initializeColorPicker(this._getInitialAccentColor());
window.zenPageAccentColorChanged = this._handleAccentColorChange.bind(this);
gZenMarketplaceManager.init();
for (const pref of [kZenExtendedSidebar, kZenSingleToolbar]) {
Services.prefs.addObserver(pref, this);
@ -743,37 +728,6 @@ var gZenLooksAndFeel = {
});
}
},
_initializeColorPicker(accentColor) {
let elem = document.getElementById('zenLooksAndFeelColorOptions');
elem.innerHTML = '';
for (let color of this.kZenColors) {
let colorElemParen = document.createElement('div');
let colorElem = document.createElement('div');
colorElemParen.classList.add('zenLooksAndFeelColorOptionParen');
colorElem.classList.add('zenLooksAndFeelColorOption');
colorElem.style.setProperty('--zen-primary-color', color, 'important');
if (accentColor === color) {
colorElemParen.setAttribute('selected', 'true');
}
colorElemParen.addEventListener('click', () => {
Services.prefs.setBoolPref('zen.theme.color-prefs.use-workspace-colors', false);
Services.prefs.setStringPref('zen.theme.accent-color', color);
});
colorElemParen.appendChild(colorElem);
elem.appendChild(colorElemParen);
}
// TODO: add custom color selection!
},
_handleAccentColorChange(accentColor) {
this._initializeColorPicker(accentColor);
},
_getInitialAccentColor() {
return Services.prefs.getStringPref('zen.theme.accent-color', this.kZenColors[0]);
},
};
var gZenWorkspacesSettings = {
@ -1183,11 +1137,6 @@ Preferences.addAll([
type: 'bool',
default: true,
},
{
id: 'zen.theme.color-prefs.use-workspace-colors',
type: 'bool',
default: false,
},
{
id: 'zen.view.compact.color-toolbar',
type: 'bool',

View file

@ -39,32 +39,6 @@
data-l10n-id="zen-vertical-tabs-newtab-top-button-up"
preference="zen.view.show-newtab-button-top"/>
</vbox>
</groupbox>
<hbox id="zenLooksCategory"
class="subcategory"
hidden="true"
data-category="paneZenLooks">
<html:h1 data-l10n-id="pane-zen-looks-title"/>
</hbox>
<groupbox id="zenLooksAndFeelGroup" data-category="paneZenLooks" hidden="true" class="highlighting-group">
<label><html:h2 data-l10n-id="zen-look-and-feel-colors-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-look-and-feel-colors-description" />
<hbox id="zenLooksAndFeelColorOptions" align="center">
</hbox>
<html:div id="zen-theme-builder-wrapper"></html:div>
<box class="indent">
<checkbox id="zenLooksAndFeelUseWorkspaceColors"
data-l10n-id="zen-look-and-feel-use-workspace-colors"
preference="zen.theme.color-prefs.use-workspace-colors"/>
</box>
<hbox id="zenLooksAndFeelGradientPickerParent"></hbox>
<html:div data-l10n-id="preferences-web-appearance-footer">
<html:a id="web-appearance-manage-themes-link" class="text-link" data-l10n-name="themes-link" href="about:addons" target="_blank" />
</html:div>

View file

@ -1,12 +0,0 @@
diff --git a/browser/components/sessionstore/content/aboutSessionRestore.xhtml b/browser/components/sessionstore/content/aboutSessionRestore.xhtml
index 05538be5d95492903e44076dc43e195cbc76c10d..3c2ee6a9d44802657c9e0d5ef6c78e0b3920a9a5 100644
--- a/browser/components/sessionstore/content/aboutSessionRestore.xhtml
+++ b/browser/components/sessionstore/content/aboutSessionRestore.xhtml
@@ -20,6 +20,7 @@
<link rel="localization" href="browser/aboutSessionRestore.ftl"/>
<link rel="localization" href="branding/brand.ftl"/>
<script src="chrome://browser/content/aboutSessionRestore.js"/>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body>

View file

@ -162,8 +162,7 @@ groupbox h2 {
/* Look and feel */
#webAppearanceSettings,
#zen-theme-builder-wrapper + box {
#webAppearanceSettings {
margin-bottom: 15px;
}
@ -203,31 +202,6 @@ groupbox h2 {
list-style-image: url('chrome://browser/skin/customize.svg');
}
#zenLooksAndFeelColorOptions {
display: grid;
grid-template-columns: repeat(auto-fill, 108px);
gap: 5px;
margin: 10px 0 15px 0;
}
.zenLooksAndFeelColorOptionParen {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 15px;
border-radius: 10px;
cursor: pointer;
background: var(--in-content-box-info-background);
width: fit-content;
margin-top: 10px;
border: 2px solid transparent;
}
.zenLooksAndFeelColorOptionParen[selected='true'] {
border-color: var(--zen-primary-color);
}
#zenLooksAndFeelGroup > html|div:last-of-type {
margin-top: 15px;
}

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/components/aboutconfig/content/aboutconfig.html b/toolkit/components/aboutconfig/content/aboutconfig.html
index 853fd8f82bd10854c7fb17a73fd10eab0a9eef52..6f5e6606ebfa95a600037b995e5c743dd5aacba5 100644
--- a/toolkit/components/aboutconfig/content/aboutconfig.html
+++ b/toolkit/components/aboutconfig/content/aboutconfig.html
@@ -34,6 +34,7 @@
<link rel="icon" href="chrome://global/skin/icons/settings.svg" />
<script src="chrome://global/content/aboutconfig/aboutconfig.js"></script>
<title data-l10n-id="about-config-page-title"></title>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body>
<div

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/components/aboutprocesses/content/aboutProcesses.html b/toolkit/components/aboutprocesses/content/aboutProcesses.html
index 1d936bcca6a606f062b9438d78a1165445468471..cbefb51920e7b2ad11621ab2b36c69fa63967dfe 100644
--- a/toolkit/components/aboutprocesses/content/aboutProcesses.html
+++ b/toolkit/components/aboutprocesses/content/aboutProcesses.html
@@ -20,6 +20,7 @@
<link rel="localization" href="branding/brand.ftl" />
<script src="chrome://global/content/aboutProcesses.js"></script>
<link rel="stylesheet" href="chrome://global/content/aboutProcesses.css" />
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body>
<table id="process-table">

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/components/printing/content/print.html b/toolkit/components/printing/content/print.html
index 72ccab596c2f090d188f1d27278f68373e5b06be..541271c71a3df749826b7f5adbd55e76450bba8f 100644
--- a/toolkit/components/printing/content/print.html
+++ b/toolkit/components/printing/content/print.html
@@ -21,6 +21,7 @@
type="module"
src="chrome://global/content/elements/moz-button-group.mjs"
></script>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body loading rendering>

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/components/prompts/content/commonDialog.xhtml b/toolkit/components/prompts/content/commonDialog.xhtml
index c47761ec958a11870e55294fe9c6de8f3afbda2f..5e0313864c67a774874c215fd043b9b8af39d8cb 100644
--- a/toolkit/components/prompts/content/commonDialog.xhtml
+++ b/toolkit/components/prompts/content/commonDialog.xhtml
@@ -30,6 +30,7 @@
<html:link rel="localization" href="branding/brand.ftl" />
<html:link rel="localization" href="toolkit/global/commonDialog.ftl" />
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</linkset>
<script src="chrome://global/content/adjustableTitle.js" />
<script src="chrome://global/content/commonDialog.js" />

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/content/aboutAbout.html b/toolkit/content/aboutAbout.html
index 74702381dd1bed2d4bb47c464ae0ca309c10e45b..f1e6b34bbf29d787bd62d625707dead024cf6011 100644
--- a/toolkit/content/aboutAbout.html
+++ b/toolkit/content/aboutAbout.html
@@ -24,6 +24,7 @@
href="chrome://branding/content/icon32.png"
/>
<script src="chrome://global/content/aboutAbout.js"></script>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body>

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/content/aboutProfiles.xhtml b/toolkit/content/aboutProfiles.xhtml
index 3ce9e580627d757e9bb3fa09601e6336e2376c73..cd69facbf05c525de061c496e08dc12096692e86 100644
--- a/toolkit/content/aboutProfiles.xhtml
+++ b/toolkit/content/aboutProfiles.xhtml
@@ -27,6 +27,7 @@
<script src="chrome://global/content/aboutProfiles.js" />
<link rel="localization" href="branding/brand.ftl" />
<link rel="localization" href="toolkit/about/aboutProfiles.ftl" />
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body id="body" class="wide-container">
<h1 data-l10n-id="profiles-title"></h1>

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml
index 7f57218f3573488445ea363e0c4532b292d53167..511f578b4ae38a496ca936adf2fef1f587249f47 100644
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -10,6 +10,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
<meta name="color-scheme" content="light dark" />
<title data-l10n-id="page-title"/>

View file

@ -1,12 +0,0 @@
diff --git a/toolkit/mozapps/extensions/content/aboutaddons.html b/toolkit/mozapps/extensions/content/aboutaddons.html
index 77702576f03cc8db7ec85bd871e6366fef935d54..edd5f27303802091c84572a7a2d3933c03cf09d9 100644
--- a/toolkit/mozapps/extensions/content/aboutaddons.html
+++ b/toolkit/mozapps/extensions/content/aboutaddons.html
@@ -86,6 +86,7 @@
type="module"
src="chrome://global/content/elements/moz-five-star.mjs"
></script>
+ <script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<body>
<drag-drop-addon-installer></drag-drop-addon-installer>

View file

@ -10,7 +10,6 @@
}
:root[zen-single-toolbar='true'] {
--urlbar-container-padding: 4px;
& #urlbar:not([breakout-extend='true']) {
padding: 1px;
--toolbarbutton-border-radius: 6px;
@ -26,7 +25,7 @@
--urlbar-margin-inline: 5px;
--urlbar-container-padding: 5px;
:root[zen-single-toolbar='true'] {
:root[zen-single-toolbar='true'] & {
--urlbar-container-padding: 4px;
}
}

View file

@ -95,11 +95,6 @@ var ZenThemeModifier = {
updateAccentColor() {
const accentColor = Services.prefs.getStringPref('zen.theme.accent-color');
document.documentElement.style.setProperty('--zen-primary-color', accentColor);
// Notify the page that the accent color has changed, only if a function
// handler is defined.
if (typeof window.zenPageAccentColorChanged === 'function') {
window.zenPageAccentColorChanged(accentColor);
}
},
};

View file

@ -39,14 +39,6 @@
document.getElementById('PanelUI-zen-gradient-generator-custom-list')
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
'allowWorkspaceColors',
'zen.theme.color-prefs.use-workspace-colors',
true,
this.onDarkModeChange.bind(this)
);
this.panel.addEventListener('popupshowing', this.handlePanelOpen.bind(this));
this.panel.addEventListener('popuphidden', this.handlePanelClose.bind(this));
this.panel.addEventListener('command', this.handlePanelCommand.bind(this));