mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 05:59:58 +02:00
Refactor theme preferences by removing unused color options and adjusting border radius settings
This commit is contained in:
parent
988056e59c
commit
1475d3daee
5 changed files with 1 additions and 229 deletions
|
@ -507,7 +507,6 @@ var gZenLooksAndFeel = {
|
|||
Services.prefs.removeObserver(pref, this);
|
||||
}
|
||||
});
|
||||
this.setDarkThemeListener();
|
||||
this.setCompactModeStyle();
|
||||
|
||||
this.applySidebarLayout();
|
||||
|
@ -560,41 +559,6 @@ var gZenLooksAndFeel = {
|
|||
}
|
||||
},
|
||||
|
||||
setDarkThemeListener() {
|
||||
const chooser = document.getElementById('zen-dark-theme-styles-form');
|
||||
const radios = [...chooser.querySelectorAll('input')];
|
||||
for (let radio of radios) {
|
||||
if (radio.value === 'amoled' && Services.prefs.getBoolPref('zen.theme.color-prefs.amoled')) {
|
||||
radio.checked = true;
|
||||
} else if (radio.value === 'colorful' && Services.prefs.getBoolPref('zen.theme.color-prefs.colorful')) {
|
||||
radio.checked = true;
|
||||
} else if (
|
||||
radio.value === 'default' &&
|
||||
!Services.prefs.getBoolPref('zen.theme.color-prefs.amoled') &&
|
||||
!Services.prefs.getBoolPref('zen.theme.color-prefs.colorful')
|
||||
) {
|
||||
radio.checked = true;
|
||||
}
|
||||
radio.addEventListener('change', (e) => {
|
||||
let value = e.target.value;
|
||||
switch (value) {
|
||||
case 'amoled':
|
||||
Services.prefs.setBoolPref('zen.theme.color-prefs.amoled', true);
|
||||
Services.prefs.setBoolPref('zen.theme.color-prefs.colorful', false);
|
||||
break;
|
||||
case 'colorful':
|
||||
Services.prefs.setBoolPref('zen.theme.color-prefs.amoled', false);
|
||||
Services.prefs.setBoolPref('zen.theme.color-prefs.colorful', true);
|
||||
break;
|
||||
default:
|
||||
Services.prefs.setBoolPref('zen.theme.color-prefs.amoled', false);
|
||||
Services.prefs.setBoolPref('zen.theme.color-prefs.colorful', false);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setCompactModeStyle() {
|
||||
const chooser = document.getElementById('zen-compact-mode-styles-form');
|
||||
const radios = [...chooser.querySelectorAll('input')];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue