Bug #240750 --> Use sane widths and heights for all resolutions, not just 800 x 600 when launching with a new profile.

This commit is contained in:
scott%scott-macgregor.org 2004-04-16 23:42:23 +00:00
Родитель 441c5f95a5
Коммит 132c9e939a
3 изменённых файлов: 21 добавлений и 8 удалений

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

@ -35,11 +35,5 @@
<NC:persist resource="chrome://messenger/content/messenger.xul#messengerWindow"/>
<NC:persist resource="chrome://messenger/content/messenger.xul#threadOutliner"/>
</RDF:Description>
<RDF:Description about="chrome://messenger/content/messenger.xul#messengerWindow">
<screenX>4</screenX>
<screenY>4</screenY>
<width>800</width>
<height>565</height>
</RDF:Description>
<RDF:Description about="chrome://messenger/content/messenger.xul#threadOutliner" height="94" />
</RDF:RDF>

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

@ -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">

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

@ -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.
}