summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-04-14 11:41:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-04-14 11:41:32 +0300
commit5a175d69f6402d6fbdd8a90650d98c346545a4fd (patch)
treee471b0040ee43572861ab09ef2a73bc5ef8d091a /src
parentb177a65e73448e889ede1fb0e9ed2b0ce1be7d3d (diff)
StdMsg: status bar icons processing moved to container
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp15
-rw-r--r--src/core/stdmsg/src/tabs.cpp27
2 files changed, 27 insertions, 15 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index c3ed9caeee..3964004faa 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1266,11 +1266,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (dis->CtlType == ODT_MENU)
return Menu_DrawItem(lParam);
- if (dis->hwndItem == m_pOwner->m_hwndStatus) {
- DrawStatusIcons(m_hContact, dis->hDC, dis->rcItem, 2);
- return TRUE;
- }
-
if (dis->CtlID == IDC_AVATAR && m_avatarPic && g_dat.bShowAvatar) {
HPEN hPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
HPEN hOldPen = (HPEN)SelectObject(dis->hDC, hPen);
@@ -1344,16 +1339,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->hwndFrom == m_pOwner->m_hwndStatus) {
- if (((LPNMHDR)lParam)->code == NM_CLICK || ((LPNMHDR)lParam)->code == NM_RCLICK) {
- NMMOUSE *nm = (NMMOUSE *)lParam;
- SendMessage(m_pOwner->m_hwndStatus, SB_GETRECT, SendMessage(m_pOwner->m_hwndStatus, SB_GETPARTS, 0, 0) - 1, (LPARAM)&rc);
- if (nm->pt.x >= rc.left)
- CheckStatusIconClick(m_hContact, m_pOwner->m_hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0);
- return TRUE;
- }
- }
-
HCURSOR hCur;
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_SRMM_LOG:
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index 4826653607..8b0e38043e 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "stdafx.h"
+#include "statusicon.h"
struct CSavedTab
{
@@ -545,7 +546,33 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
SaveWindowPosition(false);
break;
+ case WM_DRAWITEM:
+ {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
+ if (dis->hwndItem == m_hwndStatus) {
+ CSrmmBaseDialog *pDlg = (g_Settings.bTabsEnable) ? (CSrmmBaseDialog*)m_tab.GetActivePage() : m_pEmbed;
+ if (pDlg != nullptr)
+ DrawStatusIcons(pDlg->m_hContact, dis->hDC, dis->rcItem, 2);
+ return TRUE;
+ }
+ }
+ break;
+
case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->hwndFrom == m_hwndStatus) {
+ if (((LPNMHDR)lParam)->code == NM_CLICK || ((LPNMHDR)lParam)->code == NM_RCLICK) {
+ NMMOUSE *nm = (NMMOUSE *)lParam;
+ RECT rc;
+ SendMessage(m_hwndStatus, SB_GETRECT, SendMessage(m_hwndStatus, SB_GETPARTS, 0, 0) - 1, (LPARAM)&rc);
+ if (nm->pt.x >= rc.left) {
+ CSrmmBaseDialog *pDlg = (g_Settings.bTabsEnable) ? (CSrmmBaseDialog*)m_tab.GetActivePage() : m_pEmbed;
+ if (pDlg != nullptr)
+ CheckStatusIconClick(pDlg->m_hContact, m_hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0);
+ }
+ return TRUE;
+ }
+ }
+
if (((LPNMHDR)lParam)->idFrom == IDC_TAB) {
switch (((LPNMHDR)lParam)->code) {
case TCN_SELCHANGE: