Alexandre Julliard : user32: Center the icon in the caption bar.

Alexandre Julliard julliard at winehq.org
Mon Jun 17 14:07:47 CDT 2013


Module: wine
Branch: master
Commit: 094251496ccb02c0cccca4301e4464e33e423a21
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=094251496ccb02c0cccca4301e4464e33e423a21

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 17 19:30:32 2013 +0200

user32: Center the icon in the caption bar.

---

 dlls/user32/nonclient.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index bc7fcc0..050af90 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -697,11 +697,14 @@ BOOL NC_DrawSysButton (HWND hwnd, HDC hdc, BOOL down)
     if (hIcon)
     {
         RECT rect;
+        POINT pt;
         DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
         DWORD ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE );
 
         NC_GetInsideRect( hwnd, COORDS_WINDOW, &rect, style, ex_style );
-        DrawIconEx (hdc, rect.left + 2, rect.top + 1, hIcon,
+        pt.x = rect.left + 2;
+        pt.y = (rect.top + GetSystemMetrics(SM_CYCAPTION) - GetSystemMetrics(SM_CYSMICON)) / 2;
+        DrawIconEx (hdc, pt.x, pt.y, hIcon,
                     GetSystemMetrics(SM_CXSMICON),
                     GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL);
     }




More information about the wine-cvs mailing list