summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-07 15:09:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-07 18:44:33 +0300
commit0042f7550ab3d69d742c3ef90383fcdff446f850 (patch)
tree770478eb8fe83c9a41f50db3a399993b4da0f99d /plugins/TabSRMM/src
parentcbceb59a83a41f05b1b1a7812d10bc4940d4d303 (diff)
splitter data removed from common chat session settings
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp7
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp66
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp71
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--plugins/TabSRMM/src/globals.h1
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp76
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp31
-rw-r--r--plugins/TabSRMM/src/msgs.h33
-rw-r--r--plugins/TabSRMM/src/utils.cpp5
9 files changed, 117 insertions, 175 deletions
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index 76c6efdb13..8bc209800c 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -114,10 +114,6 @@ static void OnLoadSettings()
g_Settings.LogIconSize = (g_Settings.bScaleIcons) ? 12 : 16;
- g_Settings.iSplitterY = db_get_w(NULL, CHAT_MODULE, "splitY", 50);
- if (g_Settings.iSplitterY <= 20)
- g_Settings.iSplitterY = 50;
-
// nicklist
if (g_Settings.UserListFonts[0]) {
DeleteObject(g_Settings.UserListFonts[CHAT_STATUS_NORMAL]);
@@ -261,9 +257,6 @@ int Chat_Unload(void)
delete g_Settings.Highlight;
- db_set_w(NULL, CHAT_MODULE, "SplitterX", (WORD)g_Settings.iSplitterX);
- db_set_w(NULL, CHAT_MODULE, "splitY", (WORD)g_Settings.iSplitterY);
-
DestroyMenu(g_hMenu);
return 0;
}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 97e50a8b93..6ed393724d 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -256,6 +256,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
bool bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
bool bInfoPanel = m_pPanel.isActive();
int panelHeight = m_pPanel.getHeight() + 1;
+ int iSplitterX = m_pContainer->settings->iSplitterX;
RECT rcTabs;
GetClientRect(m_hwnd, &rcTabs);
@@ -295,8 +296,8 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
case IDC_LOG:
urc->rcItem.top = 0;
urc->rcItem.left = 0;
- urc->rcItem.right = bNick ? urc->dlgNewSize.cx - si->iSplitterX : urc->dlgNewSize.cx;
- urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - (PluginConfig.m_DPIscaleY > 1.0 ? DPISCALEY_S(24) : DPISCALEY_S(23))) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
+ urc->rcItem.right = bNick ? urc->dlgNewSize.cx - iSplitterX : urc->dlgNewSize.cx;
+ urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - m_iSplitterY - (PluginConfig.m_DPIscaleY > 1.0 ? DPISCALEY_S(24) : DPISCALEY_S(23))) : (urc->dlgNewSize.cy - m_iSplitterY - DPISCALEY_S(2));
if (bInfoPanel)
urc->rcItem.top += panelHeight;
if (CSkin::m_skinEnabled) {
@@ -313,8 +314,8 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
case IDC_LIST:
urc->rcItem.top = 0;
urc->rcItem.right = urc->dlgNewSize.cx;
- urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX + 2;
- urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(23)) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
+ urc->rcItem.left = urc->dlgNewSize.cx - iSplitterX + 2;
+ urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - m_iSplitterY - DPISCALEY_S(23)) : (urc->dlgNewSize.cy - m_iSplitterY - DPISCALEY_S(2));
if (bInfoPanel)
urc->rcItem.top += panelHeight;
if (CSkin::m_skinEnabled) {
@@ -329,9 +330,9 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
case IDC_SPLITTERX:
- urc->rcItem.right = urc->dlgNewSize.cx - si->iSplitterX + 2;
- urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX;
- urc->rcItem.bottom = urc->dlgNewSize.cy - si->iSplitterY - ((bToolbar && !bBottomToolbar) ? DPISCALEY_S(23) : DPISCALEY_S(2));
+ urc->rcItem.right = urc->dlgNewSize.cx - iSplitterX + 2;
+ urc->rcItem.left = urc->dlgNewSize.cx - iSplitterX;
+ urc->rcItem.bottom = urc->dlgNewSize.cy - m_iSplitterY - ((bToolbar && !bBottomToolbar) ? DPISCALEY_S(23) : DPISCALEY_S(2));
urc->rcItem.top = 0;
if (bInfoPanel)
urc->rcItem.top += panelHeight;
@@ -339,8 +340,8 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
case IDC_SPLITTERY:
urc->rcItem.right = urc->dlgNewSize.cx;
- urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY;
- urc->rcItem.bottom = urc->dlgNewSize.cy - si->iSplitterY + DPISCALEY_S(2);
+ urc->rcItem.top = urc->dlgNewSize.cy - m_iSplitterY;
+ urc->rcItem.bottom = urc->dlgNewSize.cy - m_iSplitterY + DPISCALEY_S(2);
urc->rcItem.left = 0;
urc->rcItem.bottom++;
urc->rcItem.top++;
@@ -348,7 +349,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
case IDC_MESSAGE:
urc->rcItem.right = urc->dlgNewSize.cx;
- urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY + 3;
+ urc->rcItem.top = urc->dlgNewSize.cy - m_iSplitterY + 3;
urc->rcItem.bottom = urc->dlgNewSize.cy; // - 1 ;
if (m_bIsAutosizingInput)
@@ -1581,17 +1582,10 @@ void CChatRoomDlg::OnInitDialog()
m_bIsAutosizingInput = IsAutoSplitEnabled();
m_fLimitedUpdate = false;
m_iInputAreaHeight = -1;
- if (!m_pContainer->settings->fPrivate)
- si->iSplitterY = g_Settings.iSplitterY;
- else {
- if (M.GetByte(CHAT_MODULE, "SyncSplitter", 0))
- si->iSplitterY = m_pContainer->settings->splitterPos - DPISCALEY_S(23);
- else
- si->iSplitterY = g_Settings.iSplitterY;
- }
-
+
+ m_iSplitterY = m_pContainer->settings->iSplitterY;
if (m_bIsAutosizingInput)
- si->iSplitterY = GetDefaultMinimumInputHeight();
+ m_iSplitterY = GetDefaultMinimumInputHeight();
CProxyWindow::add(this);
@@ -1601,7 +1595,7 @@ void CChatRoomDlg::OnInitDialog()
SetTimer(m_hwnd, TIMERID_TYPE, 1000, NULL);
}
- m_pPanel.getVisibility();
+ m_pPanel.setActive(false);
m_pPanel.Configure();
M.AddWindow(m_hwnd, m_hContact);
BroadCastContainer(m_pContainer, DM_REFRESHTABINDEX, 0, 0);
@@ -1681,12 +1675,6 @@ void CChatRoomDlg::OnDestroy()
TABSRMM_FireEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING, 0);
- if (!m_bIsAutosizingInput)
- db_set_w(NULL, CHAT_MODULE, "SplitterX", (WORD)g_Settings.iSplitterX);
-
- if (m_pContainer->settings->fPrivate && !IsAutoSplitEnabled())
- db_set_w(NULL, CHAT_MODULE, "splitY", (WORD)g_Settings.iSplitterY);
-
DM_FreeTheme();
UpdateTrayMenuState(this, FALSE); // remove me from the tray menu (if still there)
@@ -2429,12 +2417,12 @@ LABEL_SHOWWINDOW:
pt.x = wParam, pt.y = 0;
ScreenToClient(m_hwnd, &pt);
- si->iSplitterX = rc.right - pt.x + 1;
- if (si->iSplitterX < 35)
- si->iSplitterX = 35;
- if (si->iSplitterX > rc.right - rc.left - 35)
- si->iSplitterX = rc.right - rc.left - 35;
- g_Settings.iSplitterX = si->iSplitterX;
+ int iSplitterX = rc.right - pt.x + 1;
+ if (iSplitterX < 35)
+ iSplitterX = 35;
+ if (iSplitterX > rc.right - rc.left - 35)
+ iSplitterX = rc.right - rc.left - 35;
+ m_pContainer->settings->iSplitterX = iSplitterX;
SendMessage(m_hwnd, WM_SIZE, 0, 0);
}
else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERY) || lParam == -1) {
@@ -2443,12 +2431,12 @@ LABEL_SHOWWINDOW:
pt.x = 0, pt.y = wParam;
ScreenToClient(m_hwnd, &pt);
- si->iSplitterY = rc.bottom - pt.y + DPISCALEY_S(1);
- if (si->iSplitterY < DPISCALEY_S(23))
- si->iSplitterY = DPISCALEY_S(23);
- if (si->iSplitterY > rc.bottom - rc.top - DPISCALEY_S(40))
- si->iSplitterY = rc.bottom - rc.top - DPISCALEY_S(40);
- g_Settings.iSplitterY = si->iSplitterY;
+ m_iSplitterY = rc.bottom - pt.y + DPISCALEY_S(1);
+ if (m_iSplitterY < DPISCALEY_S(23))
+ m_iSplitterY = DPISCALEY_S(23);
+ if (m_iSplitterY > rc.bottom - rc.top - DPISCALEY_S(40))
+ m_iSplitterY = rc.bottom - rc.top - DPISCALEY_S(40);
+ m_pContainer->settings->iSplitterY = m_iSplitterY;
UpdateToolbarBG();
SendMessage(m_hwnd, WM_SIZE, 0, 0);
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index a3fcb7c383..805a331c97 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -444,8 +444,8 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar
}
if (!m_bIsAutosizingInput) {
- m_iSplitterSaved = m_splitterY;
- m_splitterY = rc.bottom / 2;
+ m_iSplitterSaved = m_iSplitterY;
+ m_iSplitterY = rc.bottom / 2;
SendMessage(m_hwnd, WM_SIZE, 1, 1);
}
@@ -465,7 +465,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar
SetDlgItemText(m_hwnd, IDC_MESSAGE, L"");
if (!m_bIsAutosizingInput) {
- m_splitterY = m_iSplitterSaved;
+ m_iSplitterY = m_iSplitterSaved;
SendMessage(m_hwnd, WM_SIZE, 0, 0);
DM_ScrollToBottom(0, 1);
}
@@ -1168,24 +1168,9 @@ int CTabBaseDlg::DM_SplitterGlobalEvent(WPARAM wParam, LPARAM lParam)
newPos = 0;
if (this == srcDat) {
- if (m_bType == SESSIONTYPE_IM) {
- m_pContainer->settings->splitterPos = m_splitterY;
- if (fCntGlobal) {
- SaveSplitter();
- if (PluginConfig.lastSPlitterPos.bSync)
- g_Settings.iSplitterY = m_splitterY - DPISCALEY_S(23);
- }
- }
- if (m_bType == SESSIONTYPE_CHAT) {
- if (si) {
- m_pContainer->settings->splitterPos = si->iSplitterY + DPISCALEY_S(23);
- if (fCntGlobal) {
- g_Settings.iSplitterY = si->iSplitterY;
- if (PluginConfig.lastSPlitterPos.bSync)
- db_set_dw(0, SRMSGMOD_T, "splitsplity", (DWORD)si->iSplitterY + DPISCALEY_S(23));
- }
- }
- }
+ m_pContainer->settings->iSplitterY = m_iSplitterY;
+ if (fCntGlobal)
+ SaveSplitter();
return 0;
}
@@ -1194,9 +1179,6 @@ int CTabBaseDlg::DM_SplitterGlobalEvent(WPARAM wParam, LPARAM lParam)
if (srcCnt->settings->fPrivate && m_pContainer != srcCnt)
return 0;
- if (!PluginConfig.lastSPlitterPos.bSync && m_bType != srcDat->m_bType)
- return 0;
-
// for inactive sessions, delay the splitter repositioning until they become
// active (faster, avoid redraw/resize problems for minimized windows)
if (IsIconic(m_pContainer->hwnd) || m_pContainer->hwndActive != m_hwnd) {
@@ -1208,21 +1190,13 @@ int CTabBaseDlg::DM_SplitterGlobalEvent(WPARAM wParam, LPARAM lParam)
}
else newPos = wParam;
- if (m_bType == SESSIONTYPE_IM) {
- LoadSplitter();
- AdjustBottomAvatarDisplay();
- DM_RecalcPictureSize();
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
- DM_ScrollToBottom(1, 1);
- if (this != srcDat)
- UpdateToolbarBG();
- }
- else {
- if (si) {
- si->iSplitterY = g_Settings.iSplitterY;
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
- }
- }
+ LoadSplitter();
+ AdjustBottomAvatarDisplay();
+ DM_RecalcPictureSize();
+ SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ DM_ScrollToBottom(1, 1);
+ if (this != srcDat)
+ UpdateToolbarBG();
return 0;
}
@@ -1387,19 +1361,12 @@ void CTabBaseDlg::DM_HandleAutoSizeRequest(REQRESIZE* rr)
if (iNewHeight > (cy - panelHeight) / 2)
iNewHeight = (cy - panelHeight) / 2;
- if (m_bType == SESSIONTYPE_IM) {
- m_dynaSplitter = rc.bottom - (rc.bottom - iNewHeight + DPISCALEY_S(2));
- if (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
- m_dynaSplitter += DPISCALEY_S(22);
- m_splitterY = m_dynaSplitter + DPISCALEY_S(34);
- DM_RecalcPictureSize();
- }
- else if (si) {
- si->iSplitterY = (rc.bottom - (rc.bottom - iNewHeight + DPISCALEY_S(3))) + DPISCALEY_S(34);
- if (!(m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR))
- si->iSplitterY -= DPISCALEY_S(22);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
- }
+ m_dynaSplitter = iNewHeight - DPISCALEY_S(2);
+ if (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
+ m_dynaSplitter += DPISCALEY_S(22);
+ m_iSplitterY = m_dynaSplitter + DPISCALEY_S(34);
+ DM_RecalcPictureSize();
+
m_iInputAreaHeight = iNewHeight;
UpdateToolbarBG();
DM_ScrollToBottom(1, 0);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 21215d7ac8..378f3e481c 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -35,7 +35,7 @@ bool g_bShutdown = false;
CGlobals PluginConfig;
-static TContainerSettings _cnt_default = { false, CNT_FLAGS_DEFAULT, CNT_FLAGSEX_DEFAULT, 255, CInfoPanel::DEGRADE_THRESHOLD, 60, L"%n (%s)", 1, 0 };
+static TContainerSettings _cnt_default = { false, CNT_FLAGS_DEFAULT, CNT_FLAGSEX_DEFAULT, 255, CInfoPanel::DEGRADE_THRESHOLD, 60, 60, L"%n (%s)", 1, 0 };
wchar_t* CGlobals::m_default_container_name = L"default";
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h
index 0763b9c854..61fcb4c966 100644
--- a/plugins/TabSRMM/src/globals.h
+++ b/plugins/TabSRMM/src/globals.h
@@ -36,7 +36,6 @@ struct TSplitterBroadCast {
LONG pos, pos_chat;
LONG off_chat, off_im;
LPARAM lParam;
- BYTE bSync;
};
typedef BOOL(WINAPI *pfnSetMenuInfo)(HMENU hmenu, LPCMENUINFO lpcmi);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index cb06147211..b6d3f2ddaf 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -800,12 +800,8 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (hwnd == GetDlgItem(hwndParent, IDC_SPLITTERY) || hwnd == GetDlgItem(hwndParent, IDC_SPLITTERY)) {
if (dat) {
GetClientRect(hwnd, &rc);
- dat->m_savedSplitter = rc.right > rc.bottom ? (short)HIWORD(GetMessagePos()) + rc.bottom / 2 : (short)LOWORD(GetMessagePos()) + rc.right / 2;
- if (dat->m_bType == SESSIONTYPE_IM)
- dat->m_savedSplitY = dat->m_splitterY;
- else
- dat->m_savedSplitY = dat->si->iSplitterY;
-
+ dat->m_iSavedMultiSplit = rc.right > rc.bottom ? (short)HIWORD(GetMessagePos()) + rc.bottom / 2 : (short)LOWORD(GetMessagePos()) + rc.right / 2;
+ dat->m_savedSplitterY = dat->m_iSplitterY;
dat->m_savedDynaSplit = dat->m_dynaSplitter;
}
}
@@ -860,7 +856,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
LONG messagePos = GetMessagePos();
GetClientRect(hwnd, &rc);
- if (hwndCapture != hwnd || dat->m_savedSplitter == (rc.right > rc.bottom ? (short)HIWORD(messagePos) + rc.bottom / 2 : (short)LOWORD(messagePos) + rc.right / 2))
+ if (hwndCapture != hwnd || dat->m_iSavedMultiSplit == (rc.right > rc.bottom ? (short)HIWORD(messagePos) + rc.bottom / 2 : (short)LOWORD(messagePos) + rc.right / 2))
break;
GetCursorPos(&pt);
@@ -886,7 +882,6 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case ID_SPLITTERCONTEXT_SAVEGLOBALFORALLSESSIONS:
{
- BYTE bSync = M.GetByte(CHAT_MODULE, "SyncSplitter", 0);
DWORD dwOff_IM = 0, dwOff_CHAT = 0;
dwOff_CHAT = -(2 + (PluginConfig.m_DPIscaleY > 1.0 ? 1 : 0));
@@ -902,20 +897,15 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
PluginConfig.lastSPlitterPos.pos_chat = rcWin.bottom - (short)HIWORD(messagePos) + rc.bottom / 2;
PluginConfig.lastSPlitterPos.off_chat = dwOff_CHAT;
PluginConfig.lastSPlitterPos.off_im = dwOff_IM;
- PluginConfig.lastSPlitterPos.bSync = bSync;
SendMessage(dat->GetHwnd(), DM_SPLITTERGLOBALEVENT, 0, 0);
M.BroadcastMessage(DM_SPLITTERGLOBALEVENT, 0, 0);
}
break;
default:
- dat->m_splitterY = dat->m_savedSplitY;
+ dat->m_iSplitterY = dat->m_savedSplitterY;
dat->m_dynaSplitter = dat->m_savedDynaSplit;
dat->DM_RecalcPictureSize();
- if (dat->m_bType == SESSIONTYPE_CHAT) {
- dat->si->iSplitterY = dat->m_savedSplitY;
- dat->m_splitterY = dat->si->iSplitterY + DPISCALEY_S(22);
- }
dat->UpdateToolbarBG();
SendMessage(hwndParent, WM_SIZE, 0, 0);
dat->DM_ScrollToBottom(0, 1);
@@ -1036,7 +1026,7 @@ void CSrmmWindow::OnInitDialog()
GetMyNick();
- m_multiSplitterX = (int)M.GetDword(SRMSGMOD, "multisplit", 150);
+ m_iMultiSplit = (int)M.GetDword(SRMSGMOD, "multisplit", 150);
m_nTypeMode = PROTOTYPE_SELFTYPING_OFF;
SetTimer(m_hwnd, TIMERID_TYPE, 1000, NULL);
m_iLastEventType = 0xffffffff;
@@ -1070,8 +1060,8 @@ void CSrmmWindow::OnInitDialog()
pt.x = 0;
ScreenToClient(m_hwnd, &pt);
m_originalSplitterY = pt.y;
- if (m_splitterY == -1)
- m_splitterY = m_originalSplitterY + 60;
+ if (m_iSplitterY == -1)
+ m_iSplitterY = m_originalSplitterY + 60;
GetWindowRect(m_message.GetHwnd(), &rc);
m_minEditBoxSize.cx = rc.right - rc.left;
@@ -1322,7 +1312,7 @@ void CSrmmWindow::OnDestroy()
M.RemoveWindow(m_hwnd);
if (m_cache->isValid())
- db_set_dw(0, SRMSGMOD, "multisplit", m_multiSplitterX);
+ db_set_dw(0, SRMSGMOD, "multisplit", m_iMultiSplit);
{
int i = GetTabIndexFromHWND(m_hwndParent, m_hwnd);
@@ -1403,8 +1393,8 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc)
if (m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED || m_bNotOnList)
urc->rcItem.bottom -= 20;
if (m_sendMode & SMODE_MULTIPLE)
- urc->rcItem.right -= (m_multiSplitterX + 3);
- urc->rcItem.bottom -= m_splitterY - m_originalSplitterY;
+ urc->rcItem.right -= (m_iMultiSplit + 3);
+ urc->rcItem.bottom -= m_iSplitterY - m_originalSplitterY;
if (!bShowToolbar || bBottomToolbar)
urc->rcItem.bottom += 21;
if (bInfoPanel)
@@ -1424,7 +1414,7 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc)
case IDC_CONTACTPIC:
GetClientRect(m_message.GetHwnd(), &rc);
- urc->rcItem.top -= m_splitterY - m_originalSplitterY;
+ urc->rcItem.top -= m_iSplitterY - m_originalSplitterY;
urc->rcItem.left = urc->rcItem.right - (m_pic.cx + 2);
if ((urc->rcItem.bottom - urc->rcItem.top) < (m_pic.cy/* + 2*/) && m_bShowAvatar) {
urc->rcItem.top = urc->rcItem.bottom - m_pic.cy;
@@ -1448,7 +1438,7 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc)
case IDC_SPLITTERY:
urc->rcItem.right = urc->dlgNewSize.cx;
- urc->rcItem.top -= m_splitterY - m_originalSplitterY;
+ urc->rcItem.top -= m_iSplitterY - m_originalSplitterY;
urc->rcItem.bottom = urc->rcItem.top + 2;
OffsetRect(&urc->rcItem, 0, 1);
urc->rcItem.left = 0;
@@ -1461,7 +1451,7 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc)
urc->rcItem.right = urc->dlgNewSize.cx;
if (m_bShowAvatar)
urc->rcItem.right -= m_pic.cx + 2;
- urc->rcItem.top -= m_splitterY - m_originalSplitterY;
+ urc->rcItem.top -= m_iSplitterY - m_originalSplitterY;
if (bBottomToolbar && bShowToolbar)
urc->rcItem.bottom -= DPISCALEY_S(22);
@@ -1483,8 +1473,8 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc)
case IDC_MULTISPLITTER:
if (bInfoPanel)
urc->rcItem.top += panelHeight;
- urc->rcItem.left -= m_multiSplitterX;
- urc->rcItem.right -= m_multiSplitterX;
+ urc->rcItem.left -= m_iMultiSplit;
+ urc->rcItem.right -= m_iMultiSplit;
urc->rcItem.bottom = rcLogBottom;
return RD_ANCHORX_RIGHT | RD_ANCHORY_HEIGHT;
@@ -1665,12 +1655,12 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
m_ipFieldHeight = CInfoPanel::m_ipConfig.height2;
if (m_pContainer->uChildMinHeight > 0 && HIWORD(lParam) >= m_pContainer->uChildMinHeight) {
- if (m_splitterY > HIWORD(lParam) - DPISCALEY_S(MINLOGHEIGHT)) {
- m_splitterY = HIWORD(lParam) - DPISCALEY_S(MINLOGHEIGHT);
- m_dynaSplitter = m_splitterY - DPISCALEY_S(34);
+ if (m_iSplitterY > HIWORD(lParam) - DPISCALEY_S(MINLOGHEIGHT)) {
+ m_iSplitterY = HIWORD(lParam) - DPISCALEY_S(MINLOGHEIGHT);
+ m_dynaSplitter = m_iSplitterY - DPISCALEY_S(34);
DM_RecalcPictureSize();
}
- if (m_splitterY < DPISCALEY_S(MINSPLITTERY))
+ if (m_iSplitterY < DPISCALEY_S(MINSPLITTERY))
LoadSplitter();
}
@@ -1740,7 +1730,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
GetClientRect(m_log.GetHwnd(), &rcLog);
rc.top = 0;
rc.right = rcClient.right;
- rc.left = rcClient.right - m_multiSplitterX;
+ rc.left = rcClient.right - m_iMultiSplit;
rc.bottom = rcLog.bottom;
if (m_pPanel.isActive())
rc.top += (m_pPanel.getHeight() + 1);
@@ -2239,13 +2229,13 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
pt.x = wParam;
pt.y = 0;
ScreenToClient(m_hwnd, &pt);
- int oldSplitterX = m_multiSplitterX;
- m_multiSplitterX = rc.right - pt.x;
- if (m_multiSplitterX < 25)
- m_multiSplitterX = 25;
+ int oldSplitterX = m_iMultiSplit;
+ m_iMultiSplit = rc.right - pt.x;
+ if (m_iMultiSplit < 25)
+ m_iMultiSplit = 25;
- if (m_multiSplitterX > ((rc.right - rc.left) - 80))
- m_multiSplitterX = oldSplitterX;
+ if (m_iMultiSplit > ((rc.right - rc.left) - 80))
+ m_iMultiSplit = oldSplitterX;
SendMessage(m_hwnd, WM_SIZE, 0, 0);
}
else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERY)) {
@@ -2255,10 +2245,10 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
pt.y = wParam;
ScreenToClient(m_hwnd, &pt);
- int oldSplitterY = m_splitterY;
+ int oldSplitterY = m_iSplitterY;
int oldDynaSplitter = m_dynaSplitter;
- m_splitterY = rc.bottom - pt.y + DPISCALEY_S(23);
+ m_iSplitterY = rc.bottom - pt.y + DPISCALEY_S(23);
// attempt to fix splitter troubles..
// hardcoded limits... better solution is possible, but this works for now
@@ -2266,13 +2256,13 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
bottomtoolbarH = 22;
- if (m_splitterY < (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH)) { // min splitter size
- m_splitterY = (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH);
- m_dynaSplitter = m_splitterY - DPISCALEY_S(34);
+ if (m_iSplitterY < (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH)) { // min splitter size
+ m_iSplitterY = (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH);
+ m_dynaSplitter = m_iSplitterY - DPISCALEY_S(34);
DM_RecalcPictureSize();
}
- else if (m_splitterY >(rc.bottom - rc.top)) {
- m_splitterY = oldSplitterY;
+ else if (m_iSplitterY >(rc.bottom - rc.top)) {
+ m_iSplitterY = oldSplitterY;
m_dynaSplitter = oldDynaSplitter;
DM_RecalcPictureSize();
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 1a7c838961..7aa63e741f 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -684,9 +684,9 @@ void CTabBaseDlg::AdjustBottomAvatarDisplay()
bool bInfoPanel = m_pPanel.isActive();
HBITMAP hbm = (bInfoPanel && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
if (hbm) {
- if (m_dynaSplitter == 0 || m_splitterY == 0)
+ if (m_dynaSplitter == 0 || m_iSplitterY == 0)
LoadSplitter();
- m_dynaSplitter = m_splitterY - DPISCALEY_S(34);
+ m_dynaSplitter = m_iSplitterY - DPISCALEY_S(34);
DM_RecalcPictureSize();
Utils::showDlgControl(m_hwnd, IDC_CONTACTPIC, m_bShowAvatar ? SW_SHOW : SW_HIDE);
InvalidateRect(GetDlgItem(m_hwnd, IDC_CONTACTPIC), NULL, TRUE);
@@ -721,7 +721,7 @@ void CTabBaseDlg::ShowPicture(bool showNewPic)
RECT rc;
GetWindowRect(GetDlgItem(m_hwnd, IDC_CONTACTPIC), &rc);
- if (m_minEditBoxSize.cy + DPISCALEY_S(3) > m_splitterY)
+ if (m_minEditBoxSize.cy + DPISCALEY_S(3) > m_iSplitterY)
SendMessage(m_hwnd, DM_SPLITTERMOVED, (WPARAM)rc.bottom - m_minEditBoxSize.cy, (LPARAM)GetDlgItem(m_hwnd, IDC_SPLITTERY));
if (!showNewPic)
SetDialogToType(m_hwnd);
@@ -1153,40 +1153,39 @@ void CTabBaseDlg::FindFirstEvent()
void CTabBaseDlg::SaveSplitter()
{
- // group chats save their normal splitter position independently
- if (m_bType == SESSIONTYPE_CHAT || m_bIsAutosizingInput)
+ if (m_bIsAutosizingInput)
return;
- if (m_splitterY < DPISCALEY_S(MINSPLITTERY) || m_splitterY < 0)
- m_splitterY = DPISCALEY_S(MINSPLITTERY);
+ if (m_iSplitterY < DPISCALEY_S(MINSPLITTERY) || m_iSplitterY < 0)
+ m_iSplitterY = DPISCALEY_S(MINSPLITTERY);
if (m_dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE)
- db_set_dw(m_hContact, SRMSGMOD_T, "splitsplity", m_splitterY);
+ db_set_dw(m_hContact, SRMSGMOD_T, "splitsplity", m_iSplitterY);
else {
if (m_pContainer->settings->fPrivate)
- m_pContainer->settings->splitterPos = m_splitterY;
+ m_pContainer->settings->iSplitterY = m_iSplitterY;
else
- db_set_dw(0, SRMSGMOD_T, "splitsplity", m_splitterY);
+ db_set_dw(0, SRMSGMOD_T, "splitsplity", m_iSplitterY);
}
}
void CTabBaseDlg::LoadSplitter()
{
if (m_bIsAutosizingInput) {
- m_splitterY = GetDefaultMinimumInputHeight();
+ m_iSplitterY = GetDefaultMinimumInputHeight();
return;
}
if (!(m_dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE)) {
if (!m_pContainer->settings->fPrivate)
- m_splitterY = (int)M.GetDword("splitsplity", (DWORD)60);
+ m_iSplitterY = (int)M.GetDword("splitsplity", 60);
else
- m_splitterY = m_pContainer->settings->splitterPos;
+ m_iSplitterY = m_pContainer->settings->iSplitterY;
}
- else m_splitterY = (int)M.GetDword(m_hContact, "splitsplity", M.GetDword("splitsplity", (DWORD)70));
+ else m_iSplitterY = (int)M.GetDword(m_hContact, "splitsplity", M.GetDword("splitsplity", 60));
- if (m_splitterY < MINSPLITTERY || m_splitterY < 0)
- m_splitterY = 150;
+ if (m_iSplitterY < MINSPLITTERY || m_iSplitterY < 0)
+ m_iSplitterY = 150;
}
void CTabBaseDlg::PlayIncomingSound() const
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 8c5c4b24db..a13f0bfd28 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -156,17 +156,17 @@ struct TLogTheme
struct TContainerSettings
{
- bool fPrivate;
- DWORD dwFlags;
- DWORD dwFlagsEx;
- DWORD dwTransparency;
- DWORD panelheight;
- DWORD splitterPos;
- wchar_t szTitleFormat[TITLE_FORMATLEN + 2];
- WORD avatarMode;
- WORD ownAvatarMode;
- WORD autoCloseSeconds;
- BYTE reserved[10];
+ bool fPrivate;
+ DWORD dwFlags;
+ DWORD dwFlagsEx;
+ DWORD dwTransparency;
+ DWORD panelheight;
+ int iSplitterY;
+ wchar_t szTitleFormat[TITLE_FORMATLEN + 2];
+ WORD avatarMode;
+ WORD ownAvatarMode;
+ WORD autoCloseSeconds;
+ int iSplitterX;
};
struct ButtonItem;
@@ -175,7 +175,7 @@ struct TContainerData
{
TContainerData *pNext;
- wchar_t szName[CONTAINER_NAMELEN + 4]; // container name
+ wchar_t szName[CONTAINER_NAMELEN + 4]; // container name
HWND hwndActive; // active message window
HWND hwnd; // the container handle
int iTabIndex; // next tab id
@@ -199,7 +199,7 @@ struct TContainerData
DWORD dwFlashingStarted;
HWND hWndOptions;
BOOL bSizingLoop;
- wchar_t szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH];
+ wchar_t szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH];
TTemplateSet *ltr_templates, *rtl_templates;
HDC cachedDC;
HBITMAP cachedHBM, oldHBM;
@@ -280,8 +280,9 @@ public:
RECT m_rcNick, m_rcUIN, m_rcStatus, m_rcPic;
MEVENT m_hDbEventFirst, m_hDbEventLast;
int m_sendMode;
- int m_splitterY, m_originalSplitterY, m_dynaSplitter, m_savedSplitter, m_savedSplitY, m_savedDynaSplit;
- int m_multiSplitterX;
+ int m_originalSplitterY;
+ int m_iSplitterY, m_dynaSplitter;
+ int m_savedSplitterY, m_savedDynaSplit;
SIZE m_minEditBoxSize;
int m_nTypeSecs;
int m_nTypeMode;
@@ -439,6 +440,7 @@ class CSrmmWindow : public CTabBaseDlg
public:
int msgTop, rcLogBottom;
+ int m_iSavedMultiSplit, m_iMultiSplit;
wchar_t *wszInitialText;
bool m_bActivate, m_bWantPopup;
@@ -704,6 +706,7 @@ struct TIconDescW
#define DM_SCROLLIEVIEW (TM_USER+102)
#define DM_UPDATEUIN (TM_USER+103)
+#define MINSPLITTERX 60
#define MINSPLITTERY 42
#define MINLOGHEIGHT 30
#define ERRORPANEL_HEIGHT 51
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 05ce83105c..06e25df02d 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -503,8 +503,11 @@ int Utils::ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettin
if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
::memcpy((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
::db_free(&dbv);
- if (hContact == 0 && szKey == 0)
+ if (hContact == 0 && szKey == 0) {
cs->fPrivate = false;
+ cs->iSplitterX = M.GetDword("splitsplitx", db_get_dw(0, CHAT_MODULE, "SplitterX", 150));
+ }
+
return 0;
}
cs->fPrivate = false;