From 51d67b220e416aabac680c66e1be306f140221f2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 17 Jan 2018 17:46:45 +0300 Subject: TabSRMM: - fixed: status icons in group chats aren't changed when needed - the status bar redraw procedure seriously optimized --- plugins/TabSRMM/src/container.cpp | 15 +++++++++++++++ plugins/TabSRMM/src/msgdialog.cpp | 8 -------- plugins/TabSRMM/src/msgs.cpp | 4 ++++ plugins/TabSRMM/src/msgs.h | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 9cf94f82e6..c01dec57bb 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -41,6 +41,12 @@ static TContainerData* TSAPI RemoveContainerFromList(TContainerData*); static bool fForceOverlayIcons = false; +void TContainerData::InitRedraw() +{ + ::KillTimer(m_hwnd, (UINT_PTR)this); + ::SetTimer(m_hwnd, (UINT_PTR)this, 100, nullptr); +} + void TContainerData::UpdateTabs() { HWND hwndTab = GetDlgItem(m_hwnd, IDC_MSGTABS); @@ -466,6 +472,15 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, } break; + case WM_TIMER: + if (wParam == (WPARAM)pContainer && pContainer->hwndStatus) { + SendMessage(pContainer->m_hwnd, WM_SIZE, 0, 0); + SendMessage(pContainer->hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0); + InvalidateRect(pContainer->hwndStatus, nullptr, TRUE); + KillTimer(hwndDlg, wParam); + } + break; + case 0xae: // must be some undocumented message - seems it messes with the title bar... if (CSkin::m_frameSkins) return 0; diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 65d3e04314..aec44485c5 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2877,14 +2877,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DM_ThemeChanged(); return 0; - case DM_STATUSICONCHANGE: - if (m_pContainer->hwndStatus) { - SendMessage(m_pContainer->m_hwnd, WM_SIZE, 0, 0); - SendMessage(m_pContainer->hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0); - InvalidateRect(m_pContainer->hwndStatus, nullptr, TRUE); - } - return 0; - case WM_CBD_UPDATED: if (lParam) CB_ChangeButton((CustomButtonData*)lParam); diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 1ee76f03e1..0c5148a635 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -149,6 +149,10 @@ INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) } return 0; + case DM_STATUSICONCHANGE: + m_pContainer->InitRedraw(); + return 0; + case DM_ACTIVATEME: // the child window will activate itself ActivateExistingTab(m_pContainer, m_hwnd); return 0; diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index fa4640bef4..6ca5ebbaba 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -225,6 +225,7 @@ struct TContainerData CMenuBar *MenuBar; CSideBar *SideBar; + void InitRedraw(); void UpdateTabs(); void UpdateTitle(MCONTACT, class CTabBaseDlg* = nullptr); -- cgit v1.2.3