mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 719318 - Better default window sizes. r=dolske
This commit is contained in:
parent
447f88c6e7
commit
c097626bc6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user