diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-12 15:51:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-12 15:51:22 +0000 |
commit | 6dc4fd2f8e7505ee9ed4e58401b1f3b7c3438efd (patch) | |
tree | 1967619a9d24d247f25f361806e29a9bf2dfaa2f /src/core/stdmsg/src/statusicon.cpp | |
parent | 9f8496a5ceeaa15fc355877fbf6401f05597383d (diff) |
- fix for drawing status bar icons;
- fix for the Unicode window procedure
git-svn-id: http://svn.miranda-ng.org/main/trunk@11348 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdmsg/src/statusicon.cpp')
-rw-r--r-- | src/core/stdmsg/src/statusicon.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/stdmsg/src/statusicon.cpp b/src/core/stdmsg/src/statusicon.cpp index 20932d34ea..0e96ec1235 100644 --- a/src/core/stdmsg/src/statusicon.cpp +++ b/src/core/stdmsg/src/statusicon.cpp @@ -36,25 +36,27 @@ static int OnSrmmIconChanged(WPARAM hContact, LPARAM) return 0;
}
-void DrawStatusIcons(MCONTACT hContact, HDC hDC, RECT r, int gap)
+void DrawStatusIcons(MCONTACT hContact, HDC hDC, const RECT &rc, int gap)
{
- int x = r.left;
+ int x = rc.left;
+ int cx_icon = GetSystemMetrics(SM_CXSMICON);
+ int cy_icon = GetSystemMetrics(SM_CYSMICON);
int nIcon = 0;
StatusIconData *sid;
- while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < r.right) {
+ while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < rc.right) {
HICON hIcon = ((sid->flags & MBF_DISABLED) && sid->hIconDisabled) ? sid->hIconDisabled : sid->hIcon;
SetBkMode(hDC, TRANSPARENT);
- DrawIconEx(hDC, x, (r.top + r.bottom - GetSystemMetrics(SM_CYSMICON)) >> 1, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
+ DrawIconEx(hDC, x, (rc.top + rc.bottom - cy_icon) >> 1, hIcon, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
- x += GetSystemMetrics(SM_CYSMICON) + gap;
+ x += cx_icon + gap;
}
}
-void CheckIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags)
+void CheckStatusIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, const RECT &rc, int gap, int click_flags)
{
- int iconNum = (pt.x - r.left) / (GetSystemMetrics(SM_CXSMICON) + gap);
+ int iconNum = (pt.x - rc.left) / (GetSystemMetrics(SM_CXSMICON) + gap);
StatusIconData *sid = Srmm_GetNthIcon(hContact, iconNum);
if (sid == NULL)
return;
|