Skip to content

Commit

Permalink
Remove old code handling custom Waterfox themes.
Browse files Browse the repository at this point in the history
Also remove unnecessary setting of default theme.
  • Loading branch information
MrAlex94 committed Sep 30, 2023
1 parent a5a275e commit abbbedd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
1 change: 0 additions & 1 deletion waterfox/browser/app/profile/01-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

pref("browser.theme.enableWaterfoxCustomizations", 1);
pref("browser.uidensity", 1);
pref("extensions.activeThemeID", "[email protected]");

// ** Theme Related Options ****************************************************
// == Theme Distribution Settings ==============================================
Expand Down
3 changes: 2 additions & 1 deletion waterfox/browser/components/WaterfoxGlue.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,10 @@ export const WaterfoxGlue = {

if (!Services.prefs.prefHasUserValue("browser.migration.waterfox_version")) {
// This is a new profile, nothing to migrate.
waterfoxUIVersion.prefs.setIntPref("browser.migration.waterfox_version", waterfoxUIVersion);
Services.prefs.setIntPref("browser.migration.waterfox_version", waterfoxUIVersion);
return;
}

async function enableTheme(id) {
const addon = await lazy.AddonManager.getAddonByID(id);
// If we found it, enable it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import { BrowserUtils } from "resource:///modules/BrowserUtils.sys.mjs";
export const UICustomizations = {
PREF_TOOLBARPOS: "browser.tabs.toolbarposition",
PREF_BOOKMARKPOS: "browser.bookmarks.toolbarposition",
PREF_DEFAULTTHEME: "browser.lepton.enabled",
PREF_ACTIVETHEME: "extensions.activeThemeID",
DEFAULT_THEMEID: "[email protected]",

init(window) {
this.styleButtonBox(window.document);
Expand All @@ -22,15 +19,6 @@ export const UICustomizations = {
this.moveBookmarksBar(window);
this.initListeners(window);
this.initPrefObservers();

// Make sure pref is aligned with active theme ID initially
let activeTheme = PrefUtils.get(this.PREF_ACTIVETHEME);
if (
activeTheme != this.DEFAULT_THEMEID &&
PrefUtils.get(this.PREF_DEFAULTTHEME)
) {
this.setDefaultThemePref(activeTheme);
}
},

initPrefObservers() {
Expand All @@ -55,17 +43,6 @@ export const UICustomizations = {
}
);

// If activeThemeID changes update default theme pref -> could expand to do more than just default or not
PrefUtils.addObserver(this.PREF_ACTIVETHEME, value => {
this.setDefaultThemePref(value);
});
},

setDefaultThemePref(prefValue) {
PrefUtils.set(
this.PREF_DEFAULTTHEME,
prefValue === this.DEFAULT_THEMEID // Currently, only lepton displays icons
);
},

initListeners(aWindow) {
Expand Down

0 comments on commit abbbedd

Please sign in to comment.