summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-03 20:15:08 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-03 20:15:08 +0000
commita09f78e53ce2bf9d74f7d8ee6334073a451c7b14 (patch)
treef5edc39dac5646923598931df3c898eb087424fa /src/modules
parent31005eb9d98102efce58f62751b9b2ee0fcfa672 (diff)
IRC buttons fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@1344 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/button/button.cpp22
1 files changed, 2 insertions, 20 deletions
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;