summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-11-25 15:48:55 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-11-25 15:48:55 +0300
commitce389c4b8fd79d1c8e158d1df0a15d6bce9119b8 (patch)
treeb0d6168c81745baee2c07a734ccdc39669c415c5 /src
parent4d82837e0d2c2eb398414ed58ce9fafb15304362 (diff)
fixes #4659 (NewStory ведёт себя по-разному с разными плагинами сообщений)
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/tabs.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index b8c33d11ac..b127e1104d 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -490,8 +490,7 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == m_hwndStatus) {
- CMsgDialog *pDlg = (g_Settings.bTabsEnable) ? (CMsgDialog*)m_tab.GetActivePage() : m_pEmbed;
- if (pDlg != nullptr)
+ if (auto *pDlg = CurrPage())
DrawStatusIcons(pDlg->m_hContact, dis->hDC, dis->rcItem, 2);
return TRUE;
}
@@ -500,12 +499,15 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
case WM_COMMAND:
if (LOWORD(wParam) == IDOK) {
- CMsgDialog *pDlg = (g_Settings.bTabsEnable) ? (CMsgDialog*)m_tab.GetActivePage() : m_pEmbed;
- if (pDlg != nullptr) {
+ if (auto *pDlg = CurrPage()) {
pDlg->m_btnOk.Click();
return TRUE;
}
}
+ else if (LOWORD(wParam) == IDCANCEL) {
+ if (auto *pDlg = CurrPage())
+ SetFocus(pDlg->GetHwnd());
+ }
break;
case WM_ACTIVATE:
@@ -526,8 +528,7 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
NMMOUSE *nm = (NMMOUSE *)lParam;
SendMessage(m_hwndStatus, SB_GETRECT, SendMessage(m_hwndStatus, SB_GETPARTS, 0, 0) - 1, (LPARAM)&rc);
if (nm->pt.x >= rc.left) {
- CMsgDialog *pDlg = (g_Settings.bTabsEnable) ? (CMsgDialog*)m_tab.GetActivePage() : m_pEmbed;
- if (pDlg != nullptr)
+ if (auto *pDlg = CurrPage())
CheckStatusIconClick(pDlg->m_hContact, m_hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0);
}
return TRUE;