diff options
author | George Hazan <ghazan@miranda.im> | 2022-10-30 18:54:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-10-30 18:54:56 +0300 |
commit | c657140a8aba3e92154c8ca2622c74308ccdf19c (patch) | |
tree | 2eb30502e8d7f9b22f642df57d8ec44b97e977a9 /plugins/DbEditorPP/src/main_window.cpp | |
parent | 3eb922de103ba874b48a88c9fc0c68a82260866e (diff) |
fixes #3232 (DbEditorPP: splitter is broken)
Diffstat (limited to 'plugins/DbEditorPP/src/main_window.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/main_window.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index b0b8221c22..20a066e0ed 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -356,22 +356,18 @@ int CMainDlg::Resizer(UTILRESIZECONTROL *urc) void CMainDlg::onChange_Splitter(CSplitter *)
{
- RECT rc2;
- GetWindowRect(m_hwnd, &rc2);
-
RECT rc;
- GetClientRect(m_hwnd, &rc);
- POINT pt = { m_splitter.GetPos(), 0 };
- ScreenToClient(m_hwnd, &pt);
+ GetWindowRect(m_hwnd, &rc);
- m_splitterPos = rc.left + pt.x + 1;
+ m_splitterPos = m_splitter.GetPos() + 1;
if (m_splitterPos < 150)
m_splitterPos = 150;
- if (m_splitterPos > rc2.right - rc2.left - 150)
- m_splitterPos = rc2.right - rc2.left - 150;
- SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SPLITTER), GWLP_USERDATA, m_splitterPos);
- g_plugin.setWord("Splitter", (uint16_t)m_splitterPos);
+ int iMaxPanelWidth = rc.right - rc.left - 150;
+ if (m_splitterPos > iMaxPanelWidth)
+ m_splitterPos = iMaxPanelWidth;
+
+ g_plugin.setWord("Splitter", (uint16_t)m_splitterPos);
PostMessage(m_hwnd, WM_SIZE, 0, 0);
}
|