summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-30 14:48:50 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-04-30 14:48:50 +0200
commita40d3f58c95a3815b302fb24066da4aaae0e5516 (patch)
tree7bef198c533d40469e67b5744a3adf6ebb460796 /src
parent0388e4a5e99d7f38718ac17c4d3e3565d1e2d559 (diff)
fixes #1285 (current tab is not updated on end resize)
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/stdafx.h10
-rw-r--r--src/core/stdmsg/src/tabs.cpp28
2 files changed, 28 insertions, 10 deletions
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index d9d52bc165..5d890b97c3 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -146,14 +146,16 @@ class CTabbedWindow : public CDlgBase
void SaveWindowPosition(bool bUpdateSession);
void SetWindowPosition();
- int iX, iY;
- int iWidth, iHeight;
- int m_windowWasCascaded;
+ int oldSizeX = 0, oldSizeY = 0;
+ int iX = 0, iY = 0;
+ int iWidth = 0, iHeight = 0;
+ int m_windowWasCascaded = 0;
+ bool m_bSizingLoop = false;
public:
CCtrlPages m_tab;
HWND m_hwndStatus;
- CMsgDialog *m_pEmbed;
+ CMsgDialog *m_pEmbed = nullptr;
CTabbedWindow();
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index bdeb30b15d..7afb64175f 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -165,10 +165,8 @@ static LRESULT CALLBACK TabSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
CTabbedWindow::CTabbedWindow() :
CDlgBase(g_hInst, IDD_CONTAINER),
- m_tab(this, IDC_TAB),
- m_pEmbed(nullptr)
+ m_tab(this, IDC_TAB)
{
- iX = iY = iWidth = iHeight = m_windowWasCascaded = 0;
}
void CTabbedWindow::OnInitDialog()
@@ -423,6 +421,7 @@ void CTabbedWindow::TabClicked()
INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
+ RECT rc;
int idx;
switch (msg) {
@@ -542,6 +541,25 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
SaveWindowPosition(false);
break;
+ case WM_ENTERSIZEMOVE:
+ GetClientRect(m_hwnd, &rc);
+ oldSizeX = rc.right - rc.left;
+ oldSizeY = rc.bottom - rc.top;
+ m_bSizingLoop = true;
+ break;
+
+ case WM_EXITSIZEMOVE:
+ GetClientRect(m_hwnd, &rc);
+ if (!((rc.right - rc.left) == oldSizeX && (rc.bottom - rc.top) == oldSizeY)) {
+ CMsgDialog *pDlg = (g_Settings.bTabsEnable) ? (CMsgDialog*)m_tab.GetActivePage() : m_pEmbed;
+ if (pDlg != nullptr) {
+ pDlg->ScrollToBottom();
+ pDlg->Resize();
+ }
+ }
+ m_bSizingLoop = false;
+ break;
+
case WM_GETMINMAXINFO:
{
MINMAXINFO *mmi = (MINMAXINFO*)lParam;
@@ -585,7 +603,6 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
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) {
CMsgDialog *pDlg = (g_Settings.bTabsEnable) ? (CMsgDialog*)m_tab.GetActivePage() : m_pEmbed;
@@ -668,8 +685,7 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT res = CDlgBase::DlgProc(msg, wParam, lParam);
if (msg == WM_SIZE) {
SendMessage(m_hwndStatus, WM_SIZE, 0, 0);
- if (m_pEmbed) {
- RECT rc;
+ if (m_pEmbed && !m_bSizingLoop) {
GetClientRect(m_tab.GetHwnd(), &rc);
MoveWindow(m_pEmbed->GetHwnd(), 0, 0, rc.right - rc.left, rc.bottom - rc.top, FALSE);
}