This commit is contained in:
locka%iol.ie 2002-07-03 20:52:05 +00:00
Родитель ecceaf0fd2
Коммит 0136f0e511
2 изменённых файлов: 17 добавлений и 6 удалений

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

@ -194,12 +194,13 @@ NS_IMETHODIMP WebBrowserChrome::DestroyBrowserWindow(void)
} }
NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) // IN: The desired browser client area dimensions.
NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(PRInt32 aWidth, PRInt32 aHeight)
{ {
/* This isn't exactly correct: we're setting the whole window to /* This isn't exactly correct: we're setting the whole window to
the size requested for the browser. At time of writing, though, the size requested for the browser. At time of writing, though,
it's fine and useful for winEmbed's purposes. */ it's fine and useful for winEmbed's purposes. */
WebBrowserChromeUI::SizeTo(this, aCX, aCY); WebBrowserChromeUI::SizeTo(this, aWidth, aHeight);
mSizeSet = PR_TRUE; mSizeSet = PR_TRUE;
return NS_OK; return NS_OK;
} }

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

@ -1302,11 +1302,21 @@ void WebBrowserChromeUI::ShowWindow(nsIWebBrowserChrome *aChrome, PRBool aShow)
void WebBrowserChromeUI::SizeTo(nsIWebBrowserChrome *aChrome, PRInt32 aWidth, PRInt32 aHeight) void WebBrowserChromeUI::SizeTo(nsIWebBrowserChrome *aChrome, PRInt32 aWidth, PRInt32 aHeight)
{ {
HWND win = GetBrowserDlgFromChrome(aChrome); HWND hchrome = GetBrowserDlgFromChrome(aChrome);
RECT winRect; HWND hbrowser = GetBrowserFromChrome(aChrome);
RECT chromeRect, browserRect;
::GetWindowRect(win, &winRect); ::GetWindowRect(hchrome, &chromeRect);
::MoveWindow(win, winRect.left, winRect.top, aWidth, aHeight, TRUE); ::GetWindowRect(hbrowser, &browserRect);
PRInt32 decoration_x = (browserRect.left - chromeRect.left) +
(chromeRect.right - browserRect.right);
PRInt32 decoration_y = (browserRect.top - chromeRect.top) +
(chromeRect.bottom - browserRect.bottom);
::MoveWindow(hchrome, chromeRect.left, chromeRect.top,
aWidth+decoration_x,
aHeight+decoration_y, TRUE);
} }
// //