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
19 changed files with 9 additions and 255 deletions

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,35 +39,9 @@
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>
<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>
</groupbox>
<hbox id="zenThemeCategory"