Fixed icons colors and other details

This commit is contained in:
mr. m
2025-02-07 01:33:48 +01:00
parent 1f6233c1e1
commit 3a5a0be013
11 changed files with 91 additions and 68 deletions

View File

@@ -33,8 +33,6 @@
this._initSidebarScrolling();
gZenUIMigration.init();
gZenCompactModeManager.init();
ZenWorkspaces.init();
gZenVerticalTabsManager.init();

View File

@@ -1,5 +1,5 @@
diff --git a/browser/base/content/browser-init.js b/browser/base/content/browser-init.js
index 63100defacf66c6b3232b9e0a783a5fd14e3a46a..eb7ed966628a595847b850f981418d425b78f14b 100644
index 63100defacf66c6b3232b9e0a783a5fd14e3a46a..22b79b021ff0baab4dac602447a124308208c828 100644
--- a/browser/base/content/browser-init.js
+++ b/browser/base/content/browser-init.js
@@ -162,13 +162,15 @@ var gBrowserInit = {
@@ -19,12 +19,11 @@ index 63100defacf66c6b3232b9e0a783a5fd14e3a46a..eb7ed966628a595847b850f981418d42
if (isVerticalTabs) {
// Show the vertical tabs toolbar
setToolbarVisibility(
@@ -287,6 +289,11 @@ var gBrowserInit = {
@@ -287,6 +289,10 @@ var gBrowserInit = {
gPrivateBrowsingUI.init();
BrowserSearch.init();
BrowserPageActions.init();
+
+Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenUIMigration.mjs", window);
+Services.scriptloader.loadSubScript("chrome://browser/content/ZenStartup.mjs", window);
+Services.scriptloader.loadSubScript("chrome://browser/content/zenThemeModifier.js", window);
+

View File

@@ -1016,7 +1016,7 @@
position: relative;
&::before {
background: light-dark(rgba(255, 255, 255, 0.85), rgba(68, 64, 64, 0.85));
backdrop-filter: invert(0.5);
margin: 2px;
border-radius: calc(var(--border-radius-medium) - 2px);
position: absolute;

View File

@@ -41,9 +41,15 @@ var gZenCompactModeManager = {
get preference() {
if (!document.documentElement.hasAttribute('zen-compact-mode')) {
document.documentElement.setAttribute(
'zen-compact-mode',
lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode')
window.addEventListener(
'MozAfterPaint',
() => {
document.documentElement.setAttribute(
'zen-compact-mode',
lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode')
);
},
{ once: true }
);
}
return lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode') === 'true';

View File

@@ -1,60 +1,64 @@
{
const PREF_NAME = 'zen.migration.version';
const MIGRATION_VERSION = 1;
const lazy = {};
class ZenUIMigration {
init() {
if (Services.prefs.prefHasUserValue(PREF_NAME)) {
this._migrate();
}
this.clearVariables();
ChromeUtils.defineESModuleGetters(lazy, {
BrowserWindowTracker: 'resource:///modules/BrowserWindowTracker.sys.mjs',
});
class ZenUIMigration {
PREF_NAME = 'zen.migration.version';
MIGRATION_VERSION = 1;
init(isNewProfile, win) {
console.log(isNewProfile, win);
if (!isNewProfile) {
this._migrate(win);
}
this.clearVariables();
}
get _migrationVersion() {
return Services.prefs.getIntPref(PREF_NAME, 0);
}
get _migrationVersion() {
return Services.prefs.getIntPref(this.PREF_NAME, 0);
}
set _migrationVersion(value) {
Services.prefs.setIntPref(PREF_NAME, value);
}
set _migrationVersion(value) {
Services.prefs.setIntPref(this.PREF_NAME, value);
}
_migrate() {
if (this._migrationVersion < 1) {
this._migrateV1();
}
}
clearVariables() {
this._migrationVersion = MIGRATION_VERSION;
window.gZenUIMigration = null;
}
async _migrateV1() {
// Introduction of the new URL bar, show a message to the user
const notification = gNotificationBox.appendNotification(
'zen-new-urlbar-notification',
{
label: { 'l10n-id': 'zen-new-urlbar-notification' },
image: 'chrome://browser/skin/notification-icons/persistent-storage-blocked.svg',
priority: gNotificationBox.PRIORITY_WARNING_HIGH,
},
[
{
'l10n-id': 'zen-disable',
accessKey: 'D',
callback: () => {
Services.prefs.setBoolPref('zen.urlbar.replace-newtab', false);
},
},
{
link: 'https://docs.zen-browser.app/user-manual/urlbar/',
'l10n-id': 'zen-learn-more-text',
},
]
);
notification.persistence = -1;
_migrate(win) {
if (this._migrationVersion < 1) {
this._migrateV1(win);
}
}
window.gZenUIMigration = new ZenUIMigration();
clearVariables() {
this._migrationVersion = this.MIGRATION_VERSION;
}
async _migrateV1(win) {
// Introduction of the new URL bar, show a message to the user
const notification = win.gNotificationBox.appendNotification(
'zen-new-urlbar-notification',
{
label: { 'l10n-id': 'zen-new-urlbar-notification' },
image: 'chrome://browser/skin/notification-icons/persistent-storage-blocked.svg',
priority: win.gNotificationBox.PRIORITY_WARNING_HIGH,
},
[
{
'l10n-id': 'zen-disable',
accessKey: 'D',
callback: () => {
Services.prefs.setBoolPref('zen.urlbar.replace-newtab', false);
},
},
{
link: 'https://docs.zen-browser.app/user-manual/urlbar/',
'l10n-id': 'zen-learn-more-text',
},
]
);
notification.persistence = -1;
}
}
export var gZenUIMigration = new ZenUIMigration();