mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Enhance ZenWelcome styling and functionality
- Add nowrap to welcome text for better layout - Change button attribute to class for primary styling - Update window centering logic to improve user experience
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
line-height: 1.1;
|
||||
max-width: 50%;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
|
||||
& > span {
|
||||
display: block;
|
||||
|
@@ -225,7 +225,7 @@
|
||||
});
|
||||
document.querySelector('#zen-welcome-page-sidebar-buttons button').remove();
|
||||
const newButton = document.querySelector('#zen-welcome-page-sidebar-buttons button');
|
||||
newButton.setAttribute('primary', 'true');
|
||||
newButton.classList.add('primary');
|
||||
document.l10n.setAttributes(newButton, 'zen-welcome-next-action');
|
||||
return false;
|
||||
},
|
||||
@@ -380,17 +380,22 @@
|
||||
}
|
||||
|
||||
function centerWindowOnScreen() {
|
||||
var xOffset = screen.availWidth / 2 - window.outerWidth / 2;
|
||||
var yOffset = screen.availHeight / 2 - window.outerHeight / 2;
|
||||
|
||||
xOffset = xOffset > 0 ? xOffset : 0;
|
||||
yOffset = yOffset > 0 ? yOffset : 0;
|
||||
window.moveTo(xOffset, yOffset);
|
||||
window.addEventListener(
|
||||
'MozAfterPaint',
|
||||
function () {
|
||||
window.resizeTo(875, 560);
|
||||
window.focus();
|
||||
appWin.center(null, true, false);
|
||||
const appWin = window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow);
|
||||
appWin.rollupAllPopups();
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
}
|
||||
|
||||
function startZenWelcome() {
|
||||
centerWindowOnScreen();
|
||||
clearBrowserElements();
|
||||
centerWindowOnScreen();
|
||||
initializeZenWelcome();
|
||||
animateInitialStage();
|
||||
}
|
||||
|
Reference in New Issue
Block a user