1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-10 04:25:31 +02:00

New welcome page and logo

This commit is contained in:
mr. M 2024-12-07 21:12:01 +01:00
parent acdca8320b
commit 5f512db55f
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
54 changed files with 299 additions and 68 deletions

View file

@ -485,6 +485,9 @@ var gZenMarketplaceManager = {
},
};
const kZenExtendedSidebar = 'zen.view.sidebar-expanded';
const kZenSingleToolbar = 'zen.view.use-single-toolbar';
var gZenLooksAndFeel = {
init() {
if (this.__hasInitialized) return;
@ -495,12 +498,57 @@ var gZenLooksAndFeel = {
gZenMarketplaceManager.init();
var onPreferColorSchemeChange = this.onPreferColorSchemeChange.bind(this);
window.matchMedia('(prefers-color-scheme: dark)').addListener(onPreferColorSchemeChange);
for (const pref of [kZenExtendedSidebar, kZenSingleToolbar]) {
Services.prefs.addObserver(pref, this);
}
this.onPreferColorSchemeChange();
window.addEventListener('unload', () => {
window.matchMedia('(prefers-color-scheme: dark)').removeListener(onPreferColorSchemeChange);
for (const pref of [kZenExtendedSidebar, kZenSingleToolbar]) {
Services.prefs.removeObserver(pref, this);
}
});
this.setDarkThemeListener();
this.setCompactModeStyle();
this.applySidebarLayout();
},
observe(subject, topic, data) {
this.applySidebarLayout();
},
applySidebarLayout() {
const isSingleToolbar = Services.prefs.getBoolPref(kZenSingleToolbar);
const isExtendedSidebar = Services.prefs.getBoolPref(kZenExtendedSidebar);
for (const layout of document.getElementById('zenLayoutList').children) {
layout.classList.remove('selected');
if (layout.getAttribute('layout') == 'single' && isSingleToolbar) {
layout.classList.add('selected');
} else if (layout.getAttribute('layout') == 'multiple' && !isSingleToolbar && isExtendedSidebar) {
layout.classList.add('selected');
} else if (layout.getAttribute('layout') == 'collapsed' && !isExtendedSidebar) {
layout.classList.add('selected');
}
}
if (this.__hasInitializedLayout) return;
this.__hasInitializedLayout = true;
for (const layout of document.getElementById('zenLayoutList').children) {
layout.addEventListener('click', () => {
if (layout.hasAttribute('disabled')) {
return;
}
for (const el of document.getElementById('zenLayoutList').children) {
el.classList.remove('selected');
}
layout.classList.add('selected');
Services.prefs.setBoolPref(kZenExtendedSidebar, layout.getAttribute('layout') != 'collapsed');
Services.prefs.setBoolPref(kZenSingleToolbar, layout.getAttribute('layout') == 'single');
});
}
},
onPreferColorSchemeChange(event) {

View file

@ -1,6 +1,50 @@
<script src="chrome://browser/content/zen-components/ZenThemeBuilder.mjs" defer=""/>
<script src="chrome://browser/content/preferences/zen-settings.js"/>
<html:template id="template-paneZenLooks">
<hbox id="zenVerticalTabsCategory"
class="subcategory"
hidden="true"
data-category="paneZenLooks">
<html:h1 data-l10n-id="zen-vertical-tabs-title"/>
</hbox>
<groupbox id="zenVerticalTabsGroup" data-category="paneZenLooks" hidden="true" class="highlighting-group">
<label><html:h2 data-l10n-id="zen-vertical-tabs-layout-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-vertical-tabs-layout-description" />
<hbox id="zenLayoutList">
<hbox layout="single">
<html:img src="chrome://browser/content/zen-images/layouts/single-toolbar.png" />
<label data-l10n-id="zen-layout-single-toolbar"></label>
</hbox>
<hbox layout="multiple">
<html:img src="chrome://browser/content/zen-images/layouts/multiple-toolbar.png" />
<label data-l10n-id="zen-layout-multiple-toolbar"></label>
</hbox>
<hbox layout="collapsed">
<html:img src="chrome://browser/content/zen-images/layouts/collapsed.png" />
<label data-l10n-id="zen-layout-collapsed-toolbar"></label>
</hbox>
</hbox>
<label><html:h2 data-l10n-id="zen-vertical-tabs-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-vertical-tabs-description" />
<checkbox id="zenLooksAndFeelNewtabUnderLastTab"
data-l10n-id="zen-vertical-tabs-newtab-on-tab-list"
preference="zen.tabs.show-newtab-vertical"/>
<vbox class="indent">
<checkbox id="zenLooksAndFeelShowTopNewtabBorder"
data-l10n-id="zen-vertical-tabs-newtab-top-button-border"
preference="zen.view.show-newtab-button-border-top"/>
<checkbox id="zenLooksAndFeelMoveNewtabToTop"
data-l10n-id="zen-vertical-tabs-newtab-top-button-up"
preference="zen.view.show-newtab-button-top"/>
<checkbox id="zenLooksAndFeelShowBottomBorder"
data-l10n-id="zen-vertical-tabs-show-bottom-border"
preference="zen.view.show-bottom-border"/>
</vbox>
</groupbox>
<hbox id="zenLooksCategory"
class="subcategory"
hidden="true"
@ -312,31 +356,4 @@
preference="zen.splitView.change-on-hover"/>
</groupbox>
<hbox id="zenVerticalTabsCategory"
class="subcategory"
hidden="true"
data-category="paneZenLooks">
<html:h1 data-l10n-id="zen-vertical-tabs-title"/>
</hbox>
<groupbox id="zenVerticalTabsGroup" data-category="paneZenLooks" hidden="true" class="highlighting-group">
<label><html:h2 data-l10n-id="zen-vertical-tabs-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-vertical-tabs-description" />
<checkbox id="zenLooksAndFeelNewtabUnderLastTab"
data-l10n-id="zen-vertical-tabs-newtab-on-tab-list"
preference="zen.tabs.show-newtab-vertical"/>
<vbox class="indent">
<checkbox id="zenLooksAndFeelShowTopNewtabBorder"
data-l10n-id="zen-vertical-tabs-newtab-top-button-border"
preference="zen.view.show-newtab-button-border-top"/>
<checkbox id="zenLooksAndFeelMoveNewtabToTop"
data-l10n-id="zen-vertical-tabs-newtab-top-button-up"
preference="zen.view.show-newtab-button-top"/>
<checkbox id="zenLooksAndFeelShowBottomBorder"
data-l10n-id="zen-vertical-tabs-show-bottom-border"
preference="zen.view.show-bottom-border"/>
</vbox>
</groupbox>
</html:template>