From a09f78e53ce2bf9d74f7d8ee6334073a451c7b14 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Aug 2012 20:15:08 +0000 Subject: IRC buttons fix git-svn-id: http://svn.miranda-ng.org/main/trunk@1344 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/button/button.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/modules') diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index cb8cad1a75..f1592c8ada 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -190,25 +190,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) iy++; } - HIMAGELIST hImageList; - HICON hIconNew; - - hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0); - ImageList_AddIcon(hImageList, ctl->hIcon); - hIconNew = ImageList_GetIcon(hImageList, 0, ILD_NORMAL); - if (textLen != 0) { - if(g_cxsmIcon + sz.cx + 8 > rcClient.right - rcClient.left) - sz.cx = (rcClient.right - rcClient.left) - g_cxsmIcon - 8; - else - sz.cx += 4; - - ix = (rcClient.right - rcClient.left) / 2 - ((g_cxsmIcon + sz.cx) / 2); - xOffset = ix + g_cxsmIcon + 4; - } - DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED); - ImageList_RemoveAll(hImageList); - ImageList_Destroy(hImageList); - DestroyIcon(hIconNew); + DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->hIcon, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED); } else if (ctl->hBitmap) { BITMAP bminfo; @@ -223,7 +205,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) } DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->hBitmap, 0, ix, iy, bminfo.bmWidth, bminfo.bmHeight, IsWindowEnabled(ctl->hwnd)?DST_BITMAP:DST_BITMAP|DSS_DISABLED); } - if (textLen>0) { + else if (textLen > 0) { // Draw the text and optinally the arrow HFONT hOldFont; -- cgit v1.2.3