Making sure dialogs really look like dialogs.

This commit is contained in:
hyatt%netscape.com 1999-07-05 19:38:43 +00:00
Родитель 6f36ff2772
Коммит a5b81247f8
4 изменённых файлов: 27 добавлений и 5 удалений

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

@ -1913,6 +1913,11 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
}
chromeFlags = CalculateChromeFlags(options);
if (aAttachArguments) {
// Opening a dialog.
chromeFlags |= NS_CHROME_OPEN_AS_DIALOG;
}
nsIWebShell *newOuterShell = nsnull;
nsIWebShellContainer *webShellContainer;
@ -2003,6 +2008,9 @@ GlobalWindowImpl::CalculateChromeFlags(char *aFeatures) {
chromeFlags |= WinHasOption(aFeatures, "chrome") ? NS_CHROME_OPEN_AS_CHROME : 0;
chromeFlags |= WinHasOption(aFeatures, "modal") ? NS_CHROME_MODAL : 0;
chromeFlags |= WinHasOption(aFeatures, "dialog") ? NS_CHROME_OPEN_AS_DIALOG : 0;
/*z-ordering, history, dependent
chromeFlags->topmost = WinHasOption(aFeatures, "alwaysRaised");
chromeFlags->bottommost = WinHasOption(aFeatures, "alwaysLowered");

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

@ -46,6 +46,8 @@ struct nsRect;
#define NS_CHROME_PERSONAL_TOOLBAR_ON 0x00000080
#define NS_CHROME_SCROLLBARS_ON 0x00000100
#define NS_CHROME_TITLEBAR_ON 0x00000200
#define NS_CHROME_MODAL 0x20000000
#define NS_CHROME_OPEN_AS_DIALOG 0x40000000
#define NS_CHROME_OPEN_AS_CHROME 0x80000000
#define NS_CHROME_ALL_CHROME 0x000003FF

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

@ -554,7 +554,7 @@ nsAppShellService::CreateDialogWindow(nsIWebShellWindow * aParent,
// temporarily disabling parentage because non-Windows platforms
// seem to be interpreting it in unexpected ways.
nsWidgetInitData widgetInitData;
widgetInitData.mBorderStyle = eBorderStyle_window;
widgetInitData.mBorderStyle = eBorderStyle_dialog;
if (aInitialWidth == NS_SIZETOCONTENT ||
aInitialHeight == NS_SIZETOCONTENT) {

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

@ -1395,10 +1395,18 @@ nsWebShellWindow::NewWebShell(PRUint32 aChromeMask, PRBool aVisible,
nsCOMPtr<nsIWebShellWindow> newWindow;
PRBool openAsDialog = ((aChromeMask & NS_CHROME_OPEN_AS_DIALOG) != 0);
// XXX Check modal chrome flag to run a modal dialog!
if ((aChromeMask & NS_CHROME_OPEN_AS_CHROME) != 0) {
// Just do a nice normal create of a web shell and
// return it immediately.
rv = appShell->CreateTopLevelWindow(nsnull, nsnull, PR_FALSE, getter_AddRefs(newWindow),
// return it immediately.
if (openAsDialog)
rv = appShell->CreateDialogWindow(nsnull, nsnull, PR_FALSE, getter_AddRefs(newWindow),
nsnull, nsnull, NS_SIZETOCONTENT, NS_SIZETOCONTENT);
else rv = appShell->CreateTopLevelWindow(nsnull, nsnull, PR_FALSE, getter_AddRefs(newWindow),
nsnull, nsnull, NS_SIZETOCONTENT, NS_SIZETOCONTENT);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIBrowserWindow> browser(do_QueryInterface(newWindow));
@ -1440,9 +1448,13 @@ nsWebShellWindow::NewWebShell(PRUint32 aChromeMask, PRBool aVisible,
NS_RELEASE(uri);
#endif // NECKO
if (NS_SUCCEEDED(rv))
rv = appShell->CreateTopLevelWindow(nsnull, urlObj, PR_FALSE, getter_AddRefs(newWindow),
if (NS_SUCCEEDED(rv)) {
if (openAsDialog)
rv = appShell->CreateDialogWindow(nsnull, urlObj, PR_FALSE, getter_AddRefs(newWindow),
nsnull, nsnull, 615, 480);
else rv = appShell->CreateTopLevelWindow(nsnull, urlObj, PR_FALSE, getter_AddRefs(newWindow),
nsnull, nsnull, 615, 480);
}
nsIAppShell *subshell;
if (NS_SUCCEEDED(rv)) {