Francois Boisvert

System icons in the small caption bars are displayed with the right size.
This commit is contained in:
Alexandre Julliard 2000-05-18 00:12:23 +00:00
parent c654c7edcb
commit 16e9237a8c
1 changed files with 32 additions and 12 deletions

View File

@ -1127,6 +1127,25 @@ static void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed)
NC_GetInsideRect95( hwnd, &rect );
/* A tool window has a smaller Close button */
if(wndPtr->dwExStyle & WS_EX_TOOLWINDOW)
{
RECT toolRect;
INT iBmpHeight = 11; /* Windows does not use SM_CXSMSIZE and SM_CYSMSIZE */
INT iBmpWidth = 11; /* it uses 11x11 for the close button in tool window */
INT iCaptionHeight = GetSystemMetrics(SM_CYSMCAPTION);
toolRect.top = rect.top + (iCaptionHeight - 1 - iBmpHeight) / 2;
toolRect.left = rect.right - (iCaptionHeight + 1 + iBmpWidth) / 2;
toolRect.bottom = toolRect.top + iBmpHeight;
toolRect.right = toolRect.left + iBmpWidth;
DrawFrameControl(hdc,&toolRect,
DFC_CAPTION,DFCS_CAPTIONCLOSE |
down ? DFCS_PUSHED : 0 |
bGrayed ? DFCS_INACTIVE : 0);
}
else
{
hdcMem = CreateCompatibleDC( hdc );
hBmp = down ? hbitmapCloseD : hbitmapClose;
hOldBmp = SelectObject (hdcMem, hBmp);
@ -1143,6 +1162,7 @@ static void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed)
SelectObject (hdcMem, hOldBmp);
DeleteDC (hdcMem);
}
}
WIN_ReleaseWndPtr(wndPtr);
}