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

fix: Fixed importing themes from a JSON file, b=(no-bug), c=common, mods

This commit is contained in:
Mr. M 2025-05-06 17:12:49 +02:00
parent 019779e425
commit 70b9f66f4c
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
4 changed files with 4 additions and 30 deletions

View file

@ -207,17 +207,9 @@ var gZenMarketplaceManager = {
const content = await file.text(); const content = await file.text();
const themes = JSON.parse(content); const themes = JSON.parse(content);
const existingThemes = await ZenThemesCommon.getThemes(); for (const theme of Object.values(themes)) {
const uniqueThemes = { ...themes, ...existingThemes }; theme.themeId = theme.id;
window.ZenInstallTheme(theme);
console.log(`[ZenThemeMarketplaceParent:settings]: Importing ${Object.keys(themes).length} themes`);
await IOUtils.writeJSON(ZenThemesCommon.themesDataFile, uniqueThemes);
this.triggerThemeUpdate();
successBox.hidden = false;
let buttonIndex = await confirmRestartPrompt(true, 1, true, true);
if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
} }
} catch (error) { } catch (error) {
console.error('[ZenThemeMarketplaceParent:settings]: Error while importing themes:', error); console.error('[ZenThemeMarketplaceParent:settings]: Error while importing themes:', error);
@ -558,7 +550,7 @@ var gZenMarketplaceManager = {
} }
input.addEventListener( input.addEventListener(
'input', 'change',
ZenThemesCommon.debounce((event) => { ZenThemesCommon.debounce((event) => {
const value = event.target.value; const value = event.target.value;

View file

@ -1,13 +0,0 @@
diff --git a/browser/themes/shared/customizableui/customizeMode.css b/browser/themes/shared/customizableui/customizeMode.css
index 6d318b05df9c48c8e6f50c5ac57a67a034dfdbc8..40eb134e0547aafc4304c4e401b36b6fa2362b07 100644
--- a/browser/themes/shared/customizableui/customizeMode.css
+++ b/browser/themes/shared/customizableui/customizeMode.css
@@ -28,7 +28,7 @@ toolbar[overflowable][customizing] > .customization-target {
#customization-container {
flex-direction: column;
min-height: 0;
- background-color: var(--toolbar-bgcolor);
+ background-color: light-dark(#f9f9fb, rgb(43, 42, 51));
color: var(--toolbar-color);
color-scheme: var(--toolbar-color-scheme);

View file

@ -147,7 +147,6 @@
--fp-contextmenu-separator-vertical: calc(4px - var(--fp-contextmenu-menuitem-border-width)); --fp-contextmenu-separator-vertical: calc(4px - var(--fp-contextmenu-menuitem-border-width));
--fp-contextmenu-separator-horizontal: 0; --fp-contextmenu-separator-horizontal: 0;
--fp-contextmenu-bgcolor: light-dark(Menu, rgb(43 42 51 / 0.95)); --fp-contextmenu-bgcolor: light-dark(Menu, rgb(43 42 51 / 0.95));
--toolbar-bgcolor: transparent;
--tab-close-button-padding: 5px !important; --tab-close-button-padding: 5px !important;

View file

@ -141,10 +141,6 @@ var gZenThemesImporter = new (class {
} }
async rebuildThemeStylesheet() { async rebuildThemeStylesheet() {
if (Services.focus.activeWindow !== window) {
return;
}
ZenThemesCommon.themes = null; ZenThemesCommon.themes = null;
await this.removeStylesheet(); await this.removeStylesheet();