feat: Set auto theme as default theme for zen, b=(no-bug), c=common, tabs

This commit is contained in:
mr. m
2025-05-05 17:26:23 +02:00
parent d816bca7e0
commit cc2c9044f3
9 changed files with 7 additions and 116 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
index 91088fab1759b9af908912648d28daa5938a29c9..3f52ee8cd77ac171fd2cbf355ade1371e57d0db5 100644
index 91088fab1759b9af908912648d28daa5938a29c9..399ee5303c909c7bd81cbfad3f0957350d49a03e 100644
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
@@ -10,15 +10,6 @@ index 91088fab1759b9af908912648d28daa5938a29c9..3f52ee8cd77ac171fd2cbf355ade1371
HomePage: "resource:///modules/HomePage.sys.mjs",
PanelMultiView: "resource:///modules/PanelMultiView.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
@@ -25,7 +26,7 @@ ChromeUtils.defineLazyGetter(lazy, "gWidgetsBundle", function () {
return Services.strings.createBundle(kUrl);
});
-const kDefaultThemeID = "default-theme@mozilla.org";
+const kDefaultThemeID = "firefox-compact-dark@mozilla.org";
const kSpecialWidgetPfx = "customizableui-special-";
@@ -338,13 +339,11 @@ var CustomizableUIInternal = {
"vertical-spacer",
"urlbar-container",

View File

@@ -1,22 +0,0 @@
diff --git a/browser/themes/BuiltInThemes.sys.mjs b/browser/themes/BuiltInThemes.sys.mjs
index cc7f6cf93e04d339fb79a028b1e5ac6e79eae9c3..85e0d653f9a6d577bdea2a1c9d53018dd45684fa 100644
--- a/browser/themes/BuiltInThemes.sys.mjs
+++ b/browser/themes/BuiltInThemes.sys.mjs
@@ -74,7 +74,7 @@ class _BuiltInThemes {
maybeInstallActiveBuiltInTheme() {
const activeThemeID = Services.prefs.getStringPref(
kActiveThemePref,
- "default-theme@mozilla.org"
+ "firefox-compact-dark@mozilla.org"
);
let activeBuiltInTheme = this.builtInThemeMap.get(activeThemeID);
@@ -166,7 +166,7 @@ class _BuiltInThemes {
async _uninstallExpiredThemes() {
const activeThemeID = Services.prefs.getStringPref(
kActiveThemePref,
- "default-theme@mozilla.org"
+ "firefox-compact-dark@mozilla.org"
);
const now = new Date();
const expiredThemes = Array.from(this.builtInThemeMap.entries()).filter(

View File

@@ -1,5 +1,5 @@
diff --git a/toolkit/modules/LightweightThemeConsumer.sys.mjs b/toolkit/modules/LightweightThemeConsumer.sys.mjs
index d8c79cbae4de3ebfc5dc62f3597c7be4965a5429..ba1a44a0be5b5837467cfc84074d4869aee6aa62 100644
index d8c79cbae4de3ebfc5dc62f3597c7be4965a5429..4398108bd6d74aa8b6689baaf5334d8ba9a26c4e 100644
--- a/toolkit/modules/LightweightThemeConsumer.sys.mjs
+++ b/toolkit/modules/LightweightThemeConsumer.sys.mjs
@@ -31,7 +31,7 @@ const toolkitVariableMap = [
@@ -11,26 +11,3 @@ index d8c79cbae4de3ebfc5dc62f3597c7be4965a5429..ba1a44a0be5b5837467cfc84074d4869
}
// Remove the alpha channel
const { r, g, b } = rgbaChannels;
@@ -339,6 +339,7 @@ LightweightThemeConsumer.prototype = {
theme.additionalBackgrounds
);
let _processedColors = _setProperties(root, hasTheme, theme);
+ this._zenSetAccentColor(root);
if (hasTheme) {
if (updateGlobalThemeData) {
@@ -431,6 +432,14 @@ LightweightThemeConsumer.prototype = {
this._lastExperimentData.stylesheet = stylesheet;
}
},
+
+ _zenSetAccentColor(root) {
+ const themeAccent = Services.prefs.getStringPref(
+ "zen.theme.accent-color",
+ "#0b57d0"
+ );
+ root.style.setProperty("--zen-primary-color", themeAccent);
+ },
};
function _getContentProperties(doc, hasTheme, data) {

View File

@@ -1,13 +0,0 @@
diff --git a/toolkit/mozapps/extensions/internal/AddonSettings.sys.mjs b/toolkit/mozapps/extensions/internal/AddonSettings.sys.mjs
index 09bb0adc97170edb414d8da91c61ec2232aa64c6..8d6fbe2b2322e4d1ccd9de3b338edfbfb4e6448f 100644
--- a/toolkit/mozapps/extensions/internal/AddonSettings.sys.mjs
+++ b/toolkit/mozapps/extensions/internal/AddonSettings.sys.mjs
@@ -119,7 +119,7 @@ if (
if (AppConstants.MOZ_DEV_EDITION) {
makeConstant("DEFAULT_THEME_ID", "firefox-compact-dark@mozilla.org");
} else {
- makeConstant("DEFAULT_THEME_ID", "default-theme@mozilla.org");
+ makeConstant("DEFAULT_THEME_ID", "firefox-compact-dark@mozilla.org");
}
// SCOPES_SIDELOAD is a bitflag for what scopes we will load new extensions from when we scan the directories.

View File

@@ -1,27 +0,0 @@
diff --git a/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs b/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
index 1b01851e2fff6d07a4be8e282bd4b85e934a7978..1354405f0b2938d2f22a3dea000405babdafd665 100644
--- a/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
+++ b/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
@@ -139,7 +139,7 @@ const KEY_APP_GLOBAL = "app-global";
const KEY_APP_PROFILE = "app-profile";
const KEY_APP_TEMPORARY = "app-temporary";
-const DEFAULT_THEME_ID = "default-theme@mozilla.org";
+const DEFAULT_THEME_ID = "firefox-compact-dark@mozilla.org";
// Properties to cache and reload when an addon installation is pending
const PENDING_INSTALL_METADATA = [
@@ -1778,8 +1778,11 @@ const updatedAddonFluentIds = new Map([
updatedAddonFluentIds.get(defaultFluentId) || defaultFluentId;
[formattedMessage] = l10n.formatMessagesSync([{ id: fluentId }]);
}
-
- return formattedMessage.value;
+ try {
+ return formattedMessage.value;
+ } catch (e) {
+ return addon.defaultLocale[aProp];
+ }
}
let [result, usedRepository] = chooseValue(

View File

@@ -1,15 +0,0 @@
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs b/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs
index 2cafde2156680a557081c5b82923f14618749358..0f4f5160f649165df80f35fbe72e02786a5b867e 100644
--- a/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs
@@ -2674,8 +2674,8 @@ export var XPIProvider = {
if (AppConstants.platform != "android") {
// Keep version in sync with toolkit/mozapps/extensions/default-theme/manifest.json
this.maybeInstallBuiltinAddon(
- "default-theme@mozilla.org",
- "1.4.1",
+ "firefox-compact-dark@mozilla.org",
+ "1.3",
"resource://default-theme/"
);
}

View File

@@ -179,6 +179,9 @@
--zen-big-shadow: 0 0 9.73px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25));
--zen-active-tab-scale: 0.98;
/* Define tab hover background color */
--tab-hover-background-color: color-mix(in srgb, var(--toolbarbutton-hover-background) 50%, transparent 50%);
/* Nativity */
--zen-native-content-radius: var(--zen-border-radius);
@media (-moz-platform: linux) {

View File

@@ -65,7 +65,7 @@
}
&:hover #urlbar-background {
background-color: light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.2)) !important;
background-color: light-dark(rgba(89, 89, 89, 0.2), rgba(255, 255, 255, 0.2)) !important;
}
}

View File

@@ -191,9 +191,6 @@
--tab-border-radius: 10px;
}
/* Define tab hover background color */
--tab-hover-background-color: color-mix(in srgb, var(--toolbarbutton-hover-background) 50%, transparent 50%);
min-width: var(--zen-toolbox-min-width);
margin-top: 0 !important; /* Fix potential issues in full screen mode */
border: none; /* Remove default borders */
@@ -1319,7 +1316,7 @@
}
&:hover .tab-background {
background: var(--tab-selected-bgcolor);
background: var(--tab-hover-background-color);
}
/* Optional blurred favicon background effect (if pref `zen.theme.essentials-favicon-bg` is enabled) */