зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1880394 - Give the icon to the dialog window class, and revert bug 1880226. r=win-reviewers,handyman
This is to be landed after the merge. I think this is better / more consistent, and avoids relying on mis-documented window style flags in MSDN. Differential Revision: https://phabricator.services.mozilla.com/D201894
This commit is contained in:
Родитель
fb929a6abc
Коммит
7758e3494a
|
@ -1221,18 +1221,19 @@ static LPWSTR const gStockApplicationIcon = MAKEINTRESOURCEW(32512);
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const wchar_t* nsWindow::ChooseWindowClass(WindowType aWindowType) {
|
const wchar_t* nsWindow::ChooseWindowClass(WindowType aWindowType) {
|
||||||
switch (aWindowType) {
|
const wchar_t* className = [aWindowType] {
|
||||||
case WindowType::Invisible:
|
switch (aWindowType) {
|
||||||
return RegisterWindowClass(kClassNameHidden, 0, gStockApplicationIcon);
|
case WindowType::Invisible:
|
||||||
case WindowType::Dialog:
|
return kClassNameHidden;
|
||||||
return RegisterWindowClass(kClassNameDialog, 0, nullptr);
|
case WindowType::Dialog:
|
||||||
case WindowType::Popup:
|
return kClassNameDialog;
|
||||||
return RegisterWindowClass(kClassNameDropShadow, 0,
|
case WindowType::Popup:
|
||||||
gStockApplicationIcon);
|
return kClassNameDropShadow;
|
||||||
default:
|
default:
|
||||||
return RegisterWindowClass(GetMainWindowClass(), 0,
|
return GetMainWindowClass();
|
||||||
gStockApplicationIcon);
|
}
|
||||||
}
|
}();
|
||||||
|
return RegisterWindowClass(className, 0, gStockApplicationIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************
|
/**************************************************************
|
||||||
|
@ -1332,7 +1333,6 @@ DWORD nsWindow::WindowStyle() {
|
||||||
|
|
||||||
// Return nsWindow extended styles
|
// Return nsWindow extended styles
|
||||||
DWORD nsWindow::WindowExStyle() {
|
DWORD nsWindow::WindowExStyle() {
|
||||||
MOZ_ASSERT_IF(mIsAlert, mWindowType == WindowType::Dialog);
|
|
||||||
switch (mWindowType) {
|
switch (mWindowType) {
|
||||||
case WindowType::Child:
|
case WindowType::Child:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1343,18 +1343,18 @@ DWORD nsWindow::WindowExStyle() {
|
||||||
}
|
}
|
||||||
return extendedStyle;
|
return extendedStyle;
|
||||||
}
|
}
|
||||||
case WindowType::Dialog: {
|
|
||||||
if (mIsAlert) {
|
|
||||||
return WS_EX_TOOLWINDOW;
|
|
||||||
}
|
|
||||||
return WS_EX_WINDOWEDGE | WS_EX_DLGMODALFRAME;
|
|
||||||
}
|
|
||||||
case WindowType::Sheet:
|
case WindowType::Sheet:
|
||||||
MOZ_FALLTHROUGH_ASSERT("Sheets are macOS specific");
|
MOZ_FALLTHROUGH_ASSERT("Sheets are macOS specific");
|
||||||
|
case WindowType::Dialog:
|
||||||
case WindowType::TopLevel:
|
case WindowType::TopLevel:
|
||||||
case WindowType::Invisible:
|
case WindowType::Invisible:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (mIsAlert) {
|
||||||
|
MOZ_ASSERT(mWindowType == WindowType::Dialog,
|
||||||
|
"Expect alert windows to have type=dialog");
|
||||||
|
return WS_EX_TOOLWINDOW;
|
||||||
|
}
|
||||||
return WS_EX_WINDOWEDGE;
|
return WS_EX_WINDOWEDGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче