update Wine to wine-1.1.15
[sugaredwine.git] / patches / 0014-taskbar-make-the-start-menu-user-drawn.patch
bloba28113fab0fc1a9e687f6361e3f4bf2f8b0ab01b
1 From 7dcacc25f9586f9e05abb9ba611a582a8a650cb7 Mon Sep 17 00:00:00 2001
2 From: Vincent Povirk <vincent@codeweavers.com>
3 Date: Thu, 18 Sep 2008 13:56:10 -0500
4 Subject: [PATCH] taskbar: make the start menu user-drawn
6 ---
7 programs/explorer/taskbar.c | 55 +++++++++++++++++++++++++++++++++++++++---
8 1 files changed, 51 insertions(+), 4 deletions(-)
10 diff --git a/programs/explorer/taskbar.c b/programs/explorer/taskbar.c
11 index f79a4c9..cae25a0 100644
12 --- a/programs/explorer/taskbar.c
13 +++ b/programs/explorer/taskbar.c
14 @@ -129,7 +129,54 @@ static LRESULT WINAPI taskbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
16 break;
18 - /* forward menu notifications to start menu */
19 + case WM_DRAWITEM:
20 + if (wparam != 0)
21 + {
22 + /* draw start button */
23 + DRAWITEMSTRUCT* dis=(DRAWITEMSTRUCT*)lparam;
24 + RECT rc;
25 + BOOL pushed;
26 + LOGFONTA lf;
27 + HFONT font, oldFont;
28 + int cxsmicon, cysmicon;
29 + HICON icon;
31 + pushed = SendMessageW(dis->hwndItem, BM_GETSTATE, 0, 0) & BST_PUSHED;
33 + /* draw button frame */
34 + DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH|(pushed?DFCS_PUSHED:0));
36 + /* calculate rect of face */
37 + rc = dis->rcItem;
39 + InflateRect(&rc, -3, -3);
40 + if (pushed)
41 + OffsetRect(&rc, 1, 1);
43 + /* draw icon */
44 + icon = LoadIconW(NULL, (LPCWSTR)IDI_WINLOGO);
45 + cxsmicon = GetSystemMetrics(SM_CXSMICON);
46 + cysmicon = GetSystemMetrics(SM_CYSMICON);
47 + DrawIconEx(dis->hDC, rc.left, rc.top, icon, cxsmicon, cysmicon, 0, NULL, DI_NORMAL);
48 + rc.left += cxsmicon+2;
49 + DestroyIcon(icon);
51 + /* draw caption */
52 + ZeroMemory(&lf, sizeof(lf));
53 + lf.lfHeight = -12;
54 + lf.lfWeight = FW_NORMAL;
55 + lf.lfPitchAndFamily = DEFAULT_PITCH|FF_SWISS;
56 + strcpy(lf.lfFaceName, "Arial");
57 + font = CreateFontIndirectA(&lf);
59 + oldFont = SelectObject(dis->hDC, font);
60 + DrawTextA(dis->hDC, "Start", -1, &rc, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_WORD_ELLIPSIS);
61 + SelectObject(dis->hDC, oldFont);
63 + DeleteObject(font);
64 + break;
65 + }
66 + /* else fall-through */
67 case WM_INITMENU:
68 case WM_INITMENUPOPUP:
69 case WM_MENUSELECT:
70 @@ -141,7 +188,7 @@ static LRESULT WINAPI taskbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
71 case WM_UNINITMENUPOPUP:
72 case WM_MENUCOMMAND:
73 case WM_MEASUREITEM:
74 - case WM_DRAWITEM:
75 + /* forward menu notifications to start menu */
76 return handle_menu(hwnd, msg, wparam, lparam);
77 break;
79 @@ -204,8 +251,8 @@ void initialize_taskbar(void)
80 InitCommonControlsEx(&initcomctl);
82 /* FIXME: make the caption translateable */
83 - startbutton = CreateWindowA( "Button", "Start", WS_CHILD|BS_PUSHBUTTON, 0, 1, 72, 24,
84 - taskbar_window, 0, 0, 0);
85 + startbutton = CreateWindowA( "Button", "Start", WS_CHILD|BS_PUSHBUTTON|BS_OWNERDRAW, 0, 1, 72, 24,
86 + taskbar_window, (HMENU)1, 0, 0);
88 tasklist_window = initialize_tasklist(taskbar_window);
90 --
91 1.5.6.5