Bug 719318 - Better default window sizes. r=dolske

This commit is contained in:
Brandon Waterloo 2013-02-12 13:29:10 -08:00
parent 447f88c6e7
commit c097626bc6

View File

@ -1256,19 +1256,33 @@ var gBrowserInit = {
// Set a sane starting width/height for all resolutions on new profiles.
if (!document.documentElement.hasAttribute("width")) {
let defaultWidth = 994;
let defaultWidth;
let defaultHeight;
// Very small: maximize the window
// Portrait : use about full width and 3/4 height, to view entire pages
// at once (without being obnoxiously tall)
// Widescreen: use about half width, to suggest side-by-side page view
// Otherwise : use 3/4 height and width
if (screen.availHeight <= 600) {
document.documentElement.setAttribute("sizemode", "maximized");
defaultWidth = 610;
defaultHeight = 450;
}
else {
// Create a narrower window for large or wide-aspect displays, to suggest
// side-by-side page view.
if (screen.availWidth >= 1600)
if (screen.availWidth <= screen.availHeight) {
defaultWidth = screen.availWidth * .9;
defaultHeight = screen.availHeight * .75;
}
else if (screen.availWidth >= 2048) {
defaultWidth = (screen.availWidth / 2) - 20;
defaultHeight = screen.availHeight - 10;
defaultHeight = screen.availHeight - 10;
}
else {
defaultWidth = screen.availWidth * .75;
defaultHeight = screen.availHeight * .75;
}
#ifdef MOZ_WIDGET_GTK2
// On X, we're not currently able to account for the size of the window
// border. Use 28px as a guess (titlebar + bottom window border)