From d166ac40b17bf2012301388cccd4abc4ce844a9f Mon Sep 17 00:00:00 2001 From: Jason Filby Date: Sat, 28 Sep 2002 22:13:28 +0000 Subject: [PATCH] Draw minimize and maximize buttons with smaller, correct, metrics svn path=/trunk/; revision=3572 --- reactos/lib/user32/windows/defwnd.c | 20 ++++++++++---------- reactos/subsys/win32k/ntuser/metric.c | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index 383b45d4271..dd8af43ebe4 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.12 2002/09/25 21:21:36 dwelch Exp $ +/* $Id: defwnd.c,v 1.13 2002/09/28 22:13:28 jfilby Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -240,8 +240,8 @@ static void UserDrawMaxButton( HWND hwnd, HDC hdc, BOOL down ) SelectObject( hdcMem, (IsZoomed(hwnd) ? (down ? hbitmapRestoreD : hbitmapRestore) : (down ? hbitmapMaximizeD : hbitmapMaximize)) ); - BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSIZE) - 1, rect.top, - GetSystemMetrics(SM_CXSIZE) + 1, GetSystemMetrics(SM_CYSIZE), hdcMem, 0, 0, + BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSMSIZE) - 1, rect.top, + GetSystemMetrics(SM_CXSMSIZE) + 1, GetSystemMetrics(SM_CYSMSIZE), hdcMem, 0, 0, SRCCOPY ); DeleteDC( hdcMem ); } @@ -256,10 +256,10 @@ static void UserDrawMinButton( HWND hwnd, HDC hdc, BOOL down) SelectObject(hdcMem, (down ? hbitmapMinimizeD : hbitmapMinimize)); if (GetWindowLong(hwnd, GWL_STYLE) & WS_MAXIMIZEBOX) { - rect.right -= GetSystemMetrics(SM_CXSIZE)+1; + rect.right -= GetSystemMetrics(SM_CXSMSIZE)+1; } - BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSIZE) - 1, rect.top, - GetSystemMetrics(SM_CXSIZE) + 1, GetSystemMetrics(SM_CYSIZE), + BitBlt( hdc, rect.right - GetSystemMetrics(SM_CXSMSIZE) - 1, rect.top, + GetSystemMetrics(SM_CXSMSIZE) + 1, GetSystemMetrics(SM_CYSMSIZE), hdcMem, 0, 0, SRCCOPY ); DeleteDC( hdcMem ); @@ -306,12 +306,12 @@ static void UserDrawCaptionNC( HDC hdc, RECT *rect, HWND hwnd, if (style & WS_MAXIMIZEBOX) { UserDrawMaxButton( hwnd, hdc, FALSE ); - r.right -= GetSystemMetrics(SM_CXSIZE) + 1; + r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1; } if (style & WS_MINIMIZEBOX) { UserDrawMinButton( hwnd, hdc, FALSE ); - r.right -= GetSystemMetrics(SM_CXSIZE) + 1; + r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1; } FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : @@ -598,7 +598,7 @@ DefWndHitTestNC(HWND hWnd, POINT Point) if (Style & WS_MAXIMIZEBOX) { - WindowRect.right -= GetSystemMetrics(SM_CXSIZE) + 1; + WindowRect.right -= GetSystemMetrics(SM_CXSMSIZE) + 1; } if (Point.x >= WindowRect.right) { @@ -607,7 +607,7 @@ DefWndHitTestNC(HWND hWnd, POINT Point) if (Style & WS_MINIMIZEBOX) { - WindowRect.right -= GetSystemMetrics(SM_CXSIZE) + 1; + WindowRect.right -= GetSystemMetrics(SM_CXSMSIZE) + 1; } if (Point.x >= WindowRect.right) { diff --git a/reactos/subsys/win32k/ntuser/metric.c b/reactos/subsys/win32k/ntuser/metric.c index 6c746d292d6..79470ebae10 100644 --- a/reactos/subsys/win32k/ntuser/metric.c +++ b/reactos/subsys/win32k/ntuser/metric.c @@ -1,4 +1,4 @@ -/* $Id: metric.c,v 1.4 2002/09/03 22:44:21 dwelch Exp $ +/* $Id: metric.c,v 1.5 2002/09/28 22:13:28 jfilby Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -58,6 +58,9 @@ NtUserGetSystemMetrics(ULONG Index) case SM_CXSIZE: case SM_CYSIZE: return(18); + case SM_CXSMSIZE: + case SM_CYSMSIZE: + return(14); default: return(0xFFFFFFFF); }