From 132c9e939adba5030260bd6241fd5da04aaad615 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Fri, 16 Apr 2004 23:42:23 +0000 Subject: [PATCH] Bug #240750 --> Use sane widths and heights for all resolutions, not just 800 x 600 when launching with a new profile. --- mail/app/profile/localstore.rdf | 6 ------ mail/base/content/messenger.xul | 2 -- mail/base/content/msgMail3PaneWindow.js | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/mail/app/profile/localstore.rdf b/mail/app/profile/localstore.rdf index 74c1819ede29..c53e5ea6618c 100644 --- a/mail/app/profile/localstore.rdf +++ b/mail/app/profile/localstore.rdf @@ -35,11 +35,5 @@ - - 4 - 4 - 800 - 565 - diff --git a/mail/base/content/messenger.xul b/mail/base/content/messenger.xul index b1b72b6463a4..9904d7e48f76 100644 --- a/mail/base/content/messenger.xul +++ b/mail/base/content/messenger.xul @@ -42,8 +42,6 @@ titlemenuseparator="&titleSeparator.label;" onload="OnLoadMessenger()" onunload="OnUnloadMessenger()" - width="750" - height="500" screenX="10" screenY="10" persist="width height screenX screenY sizemode" windowtype="mail:3pane"> diff --git a/mail/base/content/msgMail3PaneWindow.js b/mail/base/content/msgMail3PaneWindow.js index a92d2d56562d..8058dea2cb68 100644 --- a/mail/base/content/msgMail3PaneWindow.js +++ b/mail/base/content/msgMail3PaneWindow.js @@ -721,6 +721,27 @@ function OnLoadMessenger() // in delayedOnLoadMessenger... UpdateMailPaneConfig(false); + // Set a sane starting width/height for all resolutions on new profiles. Do this before the window loads + if (!document.documentElement.hasAttribute("width")) + { + var defaultWidth, defaultHeight; + if (screen.availHeight <= 600) + { + document.documentElement.setAttribute("sizemode", "maximized"); + defaultWidth = 800; + defaultHeight = 565; + } + else // for higher resolution displays, use larger values for height and width + { + defaultWidth = screen.availWidth * .8; + defaultHeight = screen.availHeight * .8; + } + + document.documentElement.setAttribute("width", defaultWidth); + document.documentElement.setAttribute("height", defaultHeight); + } + + setTimeout(delayedOnLoadMessenger, 0); // when debugging, set this to 5000, so you can see what happens after the window comes up. }