From 41b18f5309e0ed67e7bd7f26f789aacdf9417f5d Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Thu, 3 Sep 2015 10:07:07 +0000 Subject: Toaster: fixed classes icons git-svn-id: http://svn.miranda-ng.org/main/trunk@15164 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 12 ++++++------ plugins/Toaster/src/stdafx.h | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins/Toaster') diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index 9063cf3113..d2d9148c66 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -55,13 +55,13 @@ void __stdcall ShowToastNotification(void* p) if (imagePath == NULL) { - if (szProto) + if ((td->hIcon && td->bForcehIcon) || !szProto) { - imagePath = ProtoIcon(szProto); + imagePath = SaveHIcon(td->hIcon, CMStringA(FORMAT, "%p", td->hIcon)); } - else if (td->hIcon) + else if (szProto) { - imagePath = SaveHIcon(td->hIcon, CMStringA(FORMAT, "%p", td->hIcon)); + imagePath = ProtoIcon(szProto); } } } @@ -146,11 +146,11 @@ static INT_PTR CreateClassPopup(WPARAM, LPARAM lParam) { if (it->second->iFlags & PCF_TCHAR) { - CallFunctionAsync(&ShowToastNotification, new ToastData(ppc->hContact, ppc->ptszTitle, ppc->ptszText, it->second->hIcon)); + CallFunctionAsync(&ShowToastNotification, new ToastData(ppc->hContact, ppc->ptszTitle, ppc->ptszText, it->second->hIcon, 1)); } else { - CallFunctionAsync(&ShowToastNotification, new ToastData(ppc->hContact, mir_utf8decodeT(ppc->pszTitle), mir_utf8decodeT(ppc->pszText), it->second->hIcon)); + CallFunctionAsync(&ShowToastNotification, new ToastData(ppc->hContact, mir_utf8decodeT(ppc->pszTitle), mir_utf8decodeT(ppc->pszText), it->second->hIcon, 1)); } } diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index ca50132957..2e8a5bb94d 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -56,8 +56,9 @@ struct ToastData TCHAR *tszTitle; TCHAR *tszText; HICON hIcon; + bool bForcehIcon; - ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HICON _hIcon = NULL) : hContact(_hContact), tszTitle(mir_tstrdup(_tszTitle)), tszText(mir_tstrdup(_tszText)), hIcon(_hIcon) {} + ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HICON _hIcon = NULL, bool b = false) : hContact(_hContact), tszTitle(mir_tstrdup(_tszTitle)), tszText(mir_tstrdup(_tszText)), hIcon(_hIcon), bForcehIcon(b) {} ~ToastData() { mir_free(tszTitle); -- cgit v1.2.3