Bug 719318 - Better default window sizes. r=dolske

This commit is contained in:
Brandon Waterloo 2013-03-21 09:30:16 -04:00
Родитель acbe7e05ea
Коммит 7c926cee58
1 изменённых файлов: 19 добавлений и 5 удалений

Просмотреть файл

@ -1270,19 +1270,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)